fix(fetchium): Recover relay after deactivation during in-flight refetch - #6
Merged
jimmy-phantom merged 3 commits intoApr 15, 2026
Conversation
When a relay deactivates mid-refetch, deactivate() aborts the fetch and clears _abortController. The signalium ReactivePromiseImpl still shows isPending=true until the AbortError settles async. On reactivation, runDebounced() sees isPending=true and bails out, so no new fetch starts. The AbortError then permanently poisons the relay to Rejected. Detect this state (isPending && _abortController === undefined) on reactivation and call runQueryImmediately() instead. The new setPromise() call replaces _promise, causing the stale AbortError to hit signalium's promise !== this._promise guard and be silently discarded. Closes COR2-504 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pzuraq
approved these changes
Apr 10, 2026
pzuraq
left a comment
Contributor
There was a problem hiding this comment.
My only thought is maybe it makes sense to set isPending false on abort, keeping the state “accurate”, but this seems ok too
Collaborator
Author
Signalium's RelayState does not currently offer a direct way to clear isPending since it is read-only. Would we want to add something like |
jimmy-phantom
deleted the
jimmy/cor2-504-fetchium-relay-does-not-recover-after-deactivation-during
branch
April 21, 2026 16:12
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.
Summary
runDebounced()bails on reactivation because signalium'sReactivePromiseImplstill showsisPending=truefrom the doomed fetch. The AbortError then permanently poisons the relay toRejected.isPending && _abortController === undefined) on reactivation and callrunQueryImmediately()instead, which replaces_promiseso the old AbortError is silently discarded.Test plan
npm run test:unit)npm run check-types)🤖 Generated with Claude Code