Repository navigation
refactor(data): separate query lifetimes and guard async publication - #764
Merged
Merged
Conversation
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.
QueryCell combines reader definitions/cache retention with fetch generations, queued promise admission, reconciliation and state publication. Move reader slots, definition conflict checks/promotion, cache identity and timers into private QueryLifetime. QueryCell retains one generation/controller publication authority and invokes lifetime transitions through an explicit capability contract. The transition table covers initial/manual/invalidation/reconcile work, abort, reader handoff/reattachment, GC, ownerless handles and SSR. Public query contracts remain unchanged.
The transition probes reproduce six original-source failures across five paths:
Capture/check one operation pair at each publication, recheck authority across user/abort callbacks, install the new controller before predecessor abort listeners run, and retire a destroyed cache identity before its abort callbacks. Eight new cases retain the succeeding operation's result/signal and prove both zero-retention replacement and retained-cache reattachment, late result rejection, refresh usability and final eviction.
Validation:
npm run check: 439 unit, 94 repository, 2,695 jsdom, 158 browser and 12 installed type fixtures; formatting, lint, build, public types, publint and artifact checks pass. Full validation was repeated after changing destruction order; final formatting/diff checks pass.Closes #740.