Repository navigation
fix(client): prevent stale reads from restoring deleted sessions - #57222
Kyle-j-bush wants to merge 4 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
I reproduced both sequences from #56736 on the base with the bot's script, and both pass with this change: the deleted session stays out of info and family membership, and a later sync of the deleted child fetches again. The client tests (231) and typecheck pass in packages/client.
I checked how the per-read deletion set behaves with createSync. A call that joins an in-flight read never registers its own set, and the shared read keeps the first caller's set until it settles. A restart after invalidation gets a fresh set, and finally cleans up on failure, so nothing leaks and no deletion is missed while a request is pending. I have no blocking concerns.
Public API: unchanged. This is an internal change to createData, with no new or changed exports, events or endpoints.
Note: #57184 adds a similar per-read tracker for session.moved in the same session.sync function. Whichever lands second will need a rebase, and the two trackers could reasonably share one mechanism.
Related: #57139
There was a problem hiding this comment.
The new commit only merges dev; the fix and its tests are unchanged. I re-ran the #56736 reproduction on the merged head and both cases still pass. The client tests (235) and typecheck pass in packages/client. The dev changes merged into data.ts don't interact with session.sync or removeSession. Public API: unchanged. No new concerns.
There was a problem hiding this comment.
The new commit only merges dev; the fix and its tests are unchanged. I re-ran the #56736 reproduction on the new head and both cases still pass. The client tests (235) and tsc --noEmit in packages/client pass. The dev changes merged into data.ts don't affect session.sync or removeSession. Public API: unchanged. No new concerns.
Issue for this PR
Closes #56736
Type of change
What does this PR do?
Ignore sessions deleted while metadata or family reads are in flight. Deletions are tracked only until each read settles, preventing stale responses from restoring deleted records or marking them synchronized.
How did you verify your code works?
bun run checkpasses, with existing lint warnings.Screenshots / recordings
No visual layout change.
Checklist
Added by the opencode bot (AI-generated).
Related: #57139