fix(discord): release PluralKit 404 bodies#109960
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 20, 2026, 2:54 AM ET / 06:54 UTC. Summary PR surface: Source +1, Tests +2. Total +3 across 2 files. Reproducibility: no. failing current-main run was executed in this review, but the path is source-reproducible: the 404 branch returns before consuming or cancelling Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the existing missing-message contract, land the guarded 404-body cancellation with its focused regression test after exact-head CI completes, and avoid expanding the change into broader Discord or PluralKit policy work. Do we have a high-confidence way to reproduce the issue? No failing current-main run was executed in this review, but the path is source-reproducible: the 404 branch returns before consuming or cancelling Is this the best way to solve the issue? Yes. Cancelling only the 404 response body at the existing early return is the narrowest maintainable repair; it preserves the established AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e2e394e1ab80. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +2. Total +3 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
ee652cc to
d2a4574
Compare
d2a4574 to
c6a485e
Compare
c6a485e to
67670cb
Compare
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where Discord PluralKit lookups could leave a 404 response body open when a webhook message had no PluralKit record.
Why This Change Was Made
The missing-message path still returns
null, but it now cancels any response body before leaving the PluralKit lookup. The existing bounded error-body path is unchanged.User Impact
Discord users with PluralKit enabled keep the same missing-message behavior while the plugin releases upstream response streams promptly.
Evidence
./node_modules/.bin/tsx proof-pluralkit-404.tsimported the real PluralKit lookup module, exercised a 404 response with a stream body, and used a 200 JSON negative-control response to verify normal parsing still succeeds.node scripts/run-vitest.mjs extensions/discord/src/pluralkit.test.ts -- -t "returns null on 404|bounds PluralKit API error bodies"node scripts/run-vitest.mjs extensions/discord/src/pluralkit.test.tsproof-pluralkit-404.ts
AI-assisted: built with Codex