Repository navigation
fix(debates): claim the recordings key after reading the URLs, not before (GEO-2950) - #2476
Merged
ohohoreilly merged 1 commit intoSep 20, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…fore (GEO-2950) #2449 removed a permanent "Loading…" by claiming `fetchedForRef` only once URLs are committed, rather than up front. The claim still happens one line too early, which leaves a narrower version of the same bug. `geoChatRequest` returns `undefined` on a 204 (`core/debates/api.ts`), so `slot1Result.url` is a TypeError rather than a rejected request. It throws *after* the key is claimed and lands in the `.catch`, which deliberately does not release — so the key stands over null URLs, the card shows the error, and every later activation takes the `fetchedForRef.current === recordingsKey` early return and never asks again. The card is then stuck behind "Loading…" for the rest of the session, which is exactly what #2449 set out to remove. Reading both fields before claiming makes "the key was never claimed" true for every throw that can reach the catch. Deliberately NOT fixed by releasing in the `.catch`. That is what the code did before #2449, and because the key is identical across attempts it let a stale cancelled attempt free a claim a newer in-flight one owned — the original defect. Ordering is the fix; the catch stays as it is, with a comment saying why. The regression test drives a 204-shaped answer and asserts the card asks again after scrolling away and back. Checked that it bites: it fails against the previous ordering. Verified: 105 files / 1612 tests pass across core/debates; tsc clean.
ohohoreilly
force-pushed
the
ohohoreilly/geo-2950-claim-the-key-after-commit
branch
from
September 20, 2026 01:38
404f68a to
e3f27ae
Compare
ohohoreilly
deleted the
ohohoreilly/geo-2950-claim-the-key-after-commit
branch
September 20, 2026 01:52
This branch was successfully deployed
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.
Follow-up to #2449, which merged as
a8b83f69. It removed a permanentLoading…; this closes a narrower version of the same bug that the fix left behind.The gap
#2449changed the effect to claimfetchedForRefonly once URLs are committed, instead of up front. Correct, but the claim still lands one line before the values are read:geoChatRequestreturnsundefinedon a 204 (core/debates/api.ts:1642), soslot1Result.urlis aTypeErrorrather than a rejected request. It throws after the claim and lands in the.catch, which deliberately does not release — so the key stands over null URLs. The card shows its error, and every later activation takes thefetchedForRef.current === recordingsKeyearly return and never asks again.That is the permanent
Loading…#2449 set out to remove, reached through a narrower door. The.catchcomment — "The key was never claimed" — is true for a rejected request and false for this.The fix
Read both fields before claiming. That makes "never claimed" true for every throw that can reach the catch, and needs nothing else.
Deliberately not fixed by releasing in the
.catch. That is what the code did before #2449, and because the key is identical across attempts, it let a stale cancelled attempt free a claim a newer in-flight one owned — the original defect. The catch stays exactly as it is, now with a comment saying why, so this does not get "tidied" back into the old bug.Test
Drives a 204-shaped answer, then scrolls away and back, and asserts the card asks again rather than latching.
I checked that it bites rather than assuming: reverted to the previous ordering and the test fails; restored it and it passes. A regression test that passes without the fix is worth nothing.
Verification
105 files / 1612 tests pass across
core/debates;tscclean on the touched file.Context
Found while reviewing #2449, reported there as a medium finding, and merged before it was addressed — so it is live on master now. Related to GEO-2950, where the permanent-grey user report sits.