Skip to content

fix: use MIN instead of MAX for chatTitle aggregation (GSSOC 26)#290

Merged
knoxiboy merged 1 commit into
knoxiboy:mainfrom
rudra3007-pro:fix/chat-title-aggregation
May 25, 2026
Merged

fix: use MIN instead of MAX for chatTitle aggregation (GSSOC 26)#290
knoxiboy merged 1 commit into
knoxiboy:mainfrom
rudra3007-pro:fix/chat-title-aggregation

Conversation

@rudra3007-pro
Copy link
Copy Markdown
Contributor

Description

Replaced MAX(chatTitle) with MIN(chatTitle) in the chat history
session query. MAX() on a string column returns the alphabetically
last value instead of the original chat title, causing incorrect
titles to be displayed.

Related Issue

Closes #289

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Screenshots (if UI change)

N/A — this is a backend query fix with no UI change.

How Has This Been Tested?

  • Tested locally with npm run dev
  • Verified on mobile viewport (375px)
  • Verified on desktop viewport (1440px)

Manually verified that the returned chatTitle matches the original
title created for the chat session after switching to MIN().

Checklist

  • I have tested my changes locally (npm run dev)
  • My code follows the existing code style (TypeScript, Tailwind, no any types)
  • I have not introduced unrelated changes (each PR should address one issue)
  • I have added comments where necessary
  • My branch is up to date with main
  • I have linked the related issue above
  • Screenshots are included (if this is a UI change)

@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@rudra3007-pro is attempting to deploy a commit to the Karan Mani Tripathi 's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added size/xs gssoc'26 GSSoC program issue level:intermediate Intermediate level task type:bug Bug fix labels May 24, 2026
@github-actions github-actions Bot requested a review from knoxiboy May 24, 2026 15:43
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical Review

Hi @rudra3007-pro! Thank you for your contribution to DoubtDesk.

The code changes look good. Before we can complete the technical review, approve, and merge this pull request, we have one final requirement for all contributors: Please star the DoubtDesk repository.

Once you have starred the repository, please drop a comment here saying "done" (or we will automatically detect it) and we will proceed with approving and merging your PR. Thank you.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello there! 🎉 Thank you so much for your first pull request to DoubtDesk!

We really appreciate your contribution. A maintainer will review your code soon. If you are participating in GSSoC, ensure your PR is linked to an open issue. Please make sure you have followed all rules in our Contributing Guidelines. Happy coding!

@rudra3007-pro
Copy link
Copy Markdown
Contributor Author

done

Technical Review

Hi @rudra3007-pro! Thank you for your contribution to DoubtDesk.

The code changes look good. Before we can complete the technical review, approve, and merge this pull request, we have one final requirement for all contributors: Please star the DoubtDesk repository.

Once you have starred the repository, please drop a comment here saying "done" (or we will automatically detect it) and we will proceed with approving and merging your PR. Thank you.

Copy link
Copy Markdown
Owner

@knoxiboy knoxiboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: Thank you for starring the repository! The PR is approved.

@knoxiboy knoxiboy merged commit 402b63c into knoxiboy:main May 25, 2026
4 of 6 checks passed
@knoxiboy knoxiboy added gssoc:approved Approved for GSSoC mentor:knoxiboy Reviewed by mentor knoxiboy quality:clean Clean code quality and removed size/xs labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for GSSoC gssoc'26 GSSoC program issue level:intermediate Intermediate level task mentor:knoxiboy Reviewed by mentor knoxiboy quality:clean Clean code quality type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:MAX(chatTitle) returns wrong chat title in session query

2 participants