Repository navigation
Conversation
|
@SaKaNa-Y is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "e4951237fa468d87a74f108924ec58edf1ac8e57",
"result": {
"overallSummary": "Fixes a race where a wire service's initial shared-state snapshot read could be echoed back to the node side, wiping out a service that was registered concurrently. The fix tags the initial read with its own sync ID so it's excluded from outgoing writes, and skips applying it if the state was updated or deleted in the meantime; regular local writes still propagate.",
"groups": [
{
"key": "shared-state-fix",
"label": "Keep initial snapshots local",
"summary": "Gives each initial shared-state snapshot read its own sync ID, excluding that ID from outgoing writes so the stale initial value isn't echoed back to the node side. Also guards against applying a pending snapshot if the state was updated or deleted while the read was in flight, while still forwarding local writes (including those triggered from an 'updated' listener).",
"category": "core",
"filePaths": [
"packages/devframe/src/client/rpc-shared-state.ts"
],
"critical": true,
"lineNotes": [
{
"path": "packages/devframe/src/client/rpc-shared-state.ts",
"side": "additions",
"line": 112,
"text": "Skips applying the fetched snapshot if the shared state was replaced/removed or updated locally while the RPC call was pending, preventing clobbering of newer local state."
}
]
},
{
"key": "shared-state-tests",
"label": "Initial snapshot regression tests",
"summary": "Adds regression tests covering the initial snapshot race: ensures snapshots aren't echoed back, concurrent updates/writes/deletes during the pending read are respected, and writes triggered from snapshot listeners still reach the node side.",
"category": "tests",
"filePaths": [
"packages/devframe/src/client/rpc-shared-state.test.ts"
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-10-25T05:34:39.737Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
SaKaNa-Y
marked this pull request as draft
October 21, 2026 13:36
Track updates while the initial snapshot is pending. Restoring the original object after a local edit must not make a stale snapshot current again. Add an undo regression and retain initial synchronization after unchanged mutations. All required checks and the WebSocket/SSE service-discovery workflows pass.
This branch has not been 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.
Summary
When a wire service is installed while the RPC client reads its initial shared-state snapshot, the client can send the old snapshot back to the node side. This removes the service advertisement even though direct RPC calls still work. New connections then also fail to discover the installed service.
Give the initial snapshot its own sync ID and exclude that ID from outgoing writes. Track updates while the read is pending and ignore its result if the state changed or was deleted. This also preserves a local undo that restores the original object. Remove the temporary update listener when the read finishes. Local writes, including writes triggered by a snapshot listener, still reach the node side.
This PR and #422 are independent fixes with no dependency on each other. This PR is based on
mainand does not include changes from #422. It fixes initial snapshot reads; #422 fixes echoes from received broadcasts and patches.Evidence
pnpm lint,pnpm knip,pnpm typecheck, andpnpm buildpass.pnpm test --run: 157 test files pass; 1762 tests pass and 13 are skipped.Merge Danger
Door: two-way. No wire-format or public API changes.
Blast Radius: shared-state. The change affects initial reads with an
initialValue; later local writes retain their existing behavior.