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": "0179d3d088664c84fd08aa3e4b12472c255d9c43",
"result": {
"overallSummary": "Fixes a race where a wire service installed while an RPC client reads its initial shared-state snapshot could have that stale snapshot echoed back to the node side, erasing the service advertisement. The fix gives the initial snapshot its own sync ID (excluded from outgoing writes) and discards it if the state changed or was deleted in the meantime.",
"groups": [
{
"key": "fix",
"label": "Keep initial snapshots local",
"summary": "Gives the initial shared-state snapshot its own sync ID and skips sending it back to the node side, so an installed service isn't clobbered by a stale snapshot. Also guards against applying a pending snapshot if the state changed or was deleted while the read was in flight.",
"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": 111,
"text": "Pending snapshot is only applied if the shared-state entry still exists and its value hasn't changed since the read started, preventing it from overwriting a newer local write or broadcast update.",
"critical": true
}
]
},
{
"key": "tests",
"label": "Initial snapshot regression tests",
"summary": "Adds regression tests covering the initial-snapshot race: no write-back on read, preserving concurrent local writes/broadcasts, forwarding writes triggered from within the snapshot listener, and ignoring snapshots for deleted state.",
"category": "tests",
"filePaths": [
"packages/devframe/src/client/rpc-shared-state.test.ts"
],
"critical": true
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-10-21T13:32:18.297Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
SaKaNa-Y
marked this pull request as draft
October 21, 2026 13:36
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. Ignore a pending snapshot if its state changed or was deleted. 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; 1760 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.