Acknowledge Discord FAQ lookups and role changes before slow requests #20
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/JamesCicada--GTAVI-Recomp!20
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-20"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@RavenCurseBurg on GitHub · 2026-11-25 13:25 UTC · original
RavenCurseBurg:fix/faq-reply-timeout→main· +259 −12 · 5 files · 4 commits · openOn a cold FAQ cache, Cal waits up to 15 seconds for the source before sending the first interaction response. Discord requires that response within three seconds. With the pinned discord.py library and a simulated 3.25-second source delay, the first response from the current bot was ready at 3.257 seconds. Discord interaction response deadlines
This change acknowledges a cold lookup with a private loading message. A list or error updates that message. A matching answer goes to the channel and removes the loading message. Warm-cache commands still reply once. Autocomplete waits up to one second and can use the last known choices. A slow refresh continues in the background, so the next keystroke or
/faqcommand can reuse it.The
/updatescommand also made a network request before acknowledging the interaction. With a simulated 3.25-second role change, both subscribing and unsubscribing completed before the bot first replied. The command now acknowledges privately before adding or removing the role, then edits the private reply with the result. A missing role still gets an immediate reply.Eight offline tests cover the FAQ and Updates callbacks, including a missing role and a denied role change. With a simulated 3.25-second delay, both role operations acknowledged in under a millisecond and edited the reply after the change. A separate in-memory check captured ten FAQ interactions with discord.py 2.5.2, including a public answer after a slow fetch.
The new regression test first reproduced two FAQ fetches on the previous PR head. With the fix, a timed-out autocomplete and a following command use one request. Against a loopback HTTP server, eight simultaneous lookups also shared one request. Later autocomplete calls found the new FAQ, a delayed HTTP 503 allowed a retry, and closing the bot cancelled an outstanding fetch.
Windows passed all eight bot tests, 44 tooling tests, ten app0 fixtures and three CTests. Linux passed all eight bot tests on Python 3.10.22 and 3.14.10 at
ca14e8f. Linux verification jobsCI now runs the bot tests when a pull request or push to main changes the bot or its test workflow. Upstream bot test run
AI-assisted with Codex + GPT-6.2 Astra (xhigh).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.