GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(shared-state): avoid echoing received updates by dvcolomban · Pull Request #422 · devframes/devframe

Conversation

@dvcolomban

@dvcolomban dvcolomban commented Oct 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Background

A browser-side shared-state update received from the node side emits the same write back. If that write arrives after its key is deleted and recreated, the replacement accepts the old synchronization ID and loses its new value.

Changes

Suppress only the received state object and synchronization ID while applying a snapshot or patch. Restore the previous receive context after synchronous callbacks. Local writes, nested callback writes and writes to another key with the same ID still propagate.

The production change adds 20 lines and removes 3 in one file. No public API or wire-format change.

Reproduction

The added tests use native RpcFunctionsHostImpl and createRpcSharedStateClientHost. Only outgoing I/O is queued.

  1. Publish { count: 5 } from the node side and deliver its update to the browser side. Hold the resulting outgoing write.
  2. Delete the state on both sides and recreate its key as { count: 6 }. Read the replacement normally.
  3. Release the held write. Unchanged code replaces 6 with 5. This fix preserves 6 for both snapshots and patches.

In a disposable checkout of this branch, install the locked dependencies with pnpm install --frozen-lockfile. Run the same tests with the production file restored to the unchanged base, then with the fix:

git restore --source=72d917d5a57837b748bc9c950a0216049d13363e -- packages/devframe/src/client/rpc-shared-state.ts
pnpm exec vitest run --project devframe packages/devframe/src/client/rpc-shared-state-echo.test.ts
# Two failures: expected { count: 6 }, received { count: 5 }.

git restore --source=HEAD -- packages/devframe/src/client/rpc-shared-state.ts
pnpm exec vitest run --project devframe packages/devframe/src/client/rpc-shared-state-echo.test.ts
# All three cases pass.

Verification

  • Reproduced both failures on unchanged main 72d917d5, using native source only.
  • Four focused shared-state/RPC test files pass: 18 tests, including all three regressions.
  • ESLint on both changed files, devframe TypeScript checks and the devframe package build pass.

Local source checks use a cached dependency graph with Vitest 5.0.1, TypeScript 6.0.3 and Vite 8.3.1. Full CI also passes with the current lockfile: lint, Ubuntu/Windows Node 22/24/26 test jobs, end-to-end tests and Bun/Deno runtime checks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dvcolomban
fix(shared-state): avoid echoing received updates
de9c518
@vercel
vercel Bot temporarily deployed to Preview October 2, 2026 08:46 Inactive
@vercel

vercel Bot commented Oct 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
devframe Skipped Skipped Oct 2, 2026 8:46am UTC
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Oct 2, 2026
State scope and recovery dvcol/devkit-extension#8
Open
Design a portable contribution SDK and WebExtension runtime dvcol/devkit-extension#1
Open
Portable contribution proof dvcol/devkit-extension#15
Closed
@SaKaNa-Y SaKaNa-Y mentioned this pull request Oct 21, 2026
fix(shared-state): keep initial snapshots local #454
Merged

This branch was previously deployed

1 inactive deployment
Preview — de9c518f Deployed Oct 2, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot will automatically review once the pull request is marked ready for review

At least 1 approving review is required to merge this pull request.

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dvcolomban
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.