fix(credits): bound calculator component rendering #215

Open
zeyuyaoy wants to merge 3 commits from zeyuyaoy/fix-credits-command into main
zeyuyaoy commented 2026-06-25 15:03:04 +00:00 (Migrated from codeberg.org)

Fixes /credits failures as seen in #209 when users add many exams by making all rendered Discord component payloads stay within API limits.

Changes made:

  • Replace unbounded per-exam and per-course component rendering with compact summaries and paginated result pages
  • Add Discord component limit validation before update() / editReply()
  • Use short score-select custom IDs instead of embedding raw exam names
  • Paginate select options to avoid exceeding Discord's 25-option limit
  • Render CFA/TEP gen-ed unavailable notices once per result instead of once per awarded course
  • Add update/edit fallback handling

I also added some tests :)

Fixes `/credits` failures as seen in #209 when users add many exams by making all rendered Discord component payloads stay within API limits. Changes made: - Replace unbounded per-exam and per-course component rendering with compact summaries and paginated result pages - Add Discord component limit validation before `update()` / `editReply()` - Use short score-select custom IDs instead of embedding raw exam names - Paginate select options to avoid exceeding Discord's 25-option limit - Render CFA/TEP gen-ed unavailable notices once per result instead of once per awarded course - Add update/edit fallback handling I also added some tests :)
This pull request has changes conflicting with the target branch.
  • src/commands/credits.ts
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin zeyuyaoy/fix-credits-command:zeyuyaoy/fix-credits-command
git switch zeyuyaoy/fix-credits-command

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff zeyuyaoy/fix-credits-command
git switch zeyuyaoy/fix-credits-command
git rebase main
git switch main
git merge --ff-only zeyuyaoy/fix-credits-command
git switch zeyuyaoy/fix-credits-command
git rebase main
git switch main
git merge --no-ff zeyuyaoy/fix-credits-command
git switch main
git merge --squash zeyuyaoy/fix-credits-command
git switch main
git merge --ff-only zeyuyaoy/fix-credits-command
git switch main
git merge zeyuyaoy/fix-credits-command
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/dalmatian!215
No description provided.