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 can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

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 description provided.