fix(client): preserve live moves across metadata reads - #46954
Closed
kitlangton wants to merge 3 commits into
Closed
fix(client): preserve live moves across metadata reads#46954kitlangton wants to merge 3 commits into
kitlangton wants to merge 3 commits into
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.
Why
A session or family GET can serialize
/repo, then arrive aftersession.movedhas already updated the client to/worktree. The late response currently restores the old placement in the shared Solid cache, which clients use to follow the active session's directory.Independent review found two gaps in earlier revisions: a saved move could overwrite a later repository adoption (
3223615646), and unresolved adoption could prevent a subsequent complete move from being applied (181283c0fd). The latter caused an unnecessary GET whose failure rejected an otherwise successful sync. Both counterexamples are now maintained regressions.Latest correction:
3f2aef16a1handles complete same-session moves before the unresolved-placement guard, restoring their non-placement fields from the original fetched row without adding state or another synchronization mechanism.What Changes
Each pending metadata read records only the move and repository-resolution events it observes. Before publishing the HTTP response, it folds those facts in order, applying repository identity changes through the same
Worktree.adoptlogic used by live events.Placement observations are released when the read settles, including failures. Existing sync deduplication, serial invalidation/revalidation, and reconnect invalidation remain intact. Publication does not expose an intermediate stale directory or add another move-history row.
Scope
Client cache correctness only, with deterministic transport-seam tests using real
createDataand the Promise client. No protocol or durable-event changes. This does not address the separately diagnosed missing-shell/new-session startup incident, and no live-service or visual end-to-end verification is claimed. The revised head requires independent verification before approval; all earlier commits and reviewer scratch evidence remain intact.Verification
move → adoption → already-resolved GETcases failed on3223615646and now pass.181283c0fd, both cold session/familymove → unknown adoption → complete movecases and the subsequent-known-adoption variant failed when unnecessary follow-up requests returned 503. The other-session and final-unresolved-adoption controls already passed. After the narrow reducer correction, all five pass, with exact request-count assertions.3f2aef16a1; hooks were not bypassed. New-head CI and independent verification are still required before approval.solid-data.test.tsexposed two existing proxy-sensitive assertions (assistant content replacement and background shell metadata), also reproduced with unchanged based9c85d8d95. Those unrelated assertions remain outside this change.