fix: raise course picker limit from 300 to 500 to prevent truncation#16
Open
coldfinity wants to merge 1 commit into
Open
fix: raise course picker limit from 300 to 500 to prevent truncation#16coldfinity wants to merge 1 commit into
coldfinity wants to merge 1 commit into
Conversation
With 432 qualifying courses in the 2026 handbook, the previous LIMIT 300 silently truncated the alphabetically-sorted list. C6004 (Master of Data Science) sat at row 310 and never appeared in any course picker dropdown. All call sites now pass 500 to leave headroom for future handbook years.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The course picker dropdown was missing courses, C6004 (Master of Data Science), C6001 (Masters of Information Technology) etc. The dropdown appeared to stop partway through the alphabetically-sorted list.
Root cause
listCoursesForPickerappliesWHERE credit_points > 0 ORDER BY title LIMIT 300. With 432 qualifying courses in the 2026 handbook, the LIMIT silently truncated 132 courses alphabetically past row 300.Diagnostic queries run
Fix
Bumped the limit from 300 to 500 across all call sites, plus raised the default parameter:
lib/db/queries.ts50 → 500app/actions.ts300 → 500app/page.tsx300 → 500app/courses/[code]/page.tsx300 → 500app/units/[code]/page.tsx300 → 500app/tree/page.tsx300 → 500500 was chosen to leave headroom. Can be modified to a suitable integer.
Testing
pnpm --filter webapp buildpnpm --filter webapp testpnpm --filter webapp dev/,/tree,/courses/*,/units/*— all populated correctlyHow to verify
http://localhost:3000/tree,/courses/C6004,/units/all render the same picker in their respective page shells