Skip to content

fix(settings): persist client-first settings updates - #423

Draft
SaKaNa-Y wants to merge 1 commit into
devframes:mainfrom
SaKaNa-Y:fix/client-settings-persistence
Draft

SaKaNa-Y wants to merge 1 commit into
devframes:mainfrom
SaKaNa-Y:fix/client-settings-persistence

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Important

Please take a moment to read this. Thank you!

I should include a brief explanation of the problem in my own words in every PR. If that explanation is missing, please @mention me and do not merge this PR until I have added it. You may also leave this PR unaddressed (because this means I have not fulfilled my responsibilities as the author).

If my explanation is unclear or difficult to follow, please ask me to clarify or provide reproduction steps or supporting evidence.

I welcome suggestions and counterarguments, especially questions about anything I may have overlooked. (Your feedback helps me learn and improve. 🙏)

I hold myself to this standard for every PR, regardless of its size.

Summary

When a client saves scoped settings before the server accesses them, the values disappear after a server restart. I expect those settings to survive the restart without requiring server-side initialization.

The sync handler creates an in-memory state first. Later settings access reuses that state, so file storage never receives the updates. Resolve reserved settings keys to file storage on first access, and reuse that state for reads, snapshots, and patches.

Client settings read or update
  Resolve the settings scope and namespace
  Load or create file storage
  Reuse the state for sync and node settings

Evidence

  • Before: The new project/global regression cases both returned undefined after creating a fresh host with the same storage.
    After: Both return the saved settings without prior node settings access.
  • Added coverage for existing-file patch updates, scope and namespace isolation, ordinary in-memory state, and keys that escape the settings directory.
  • Built-package smoke test: the public client saved project/global settings over WebSocket. A separate process read both values after restart. Initial client sync settled before each write.
  • Passed pnpm lint, pnpm knip, CI=true pnpm test --run, pnpm typecheck, and pnpm build. The suite passed 1,641 tests across 147 files, with 13 skipped tests. The final build completed all 28 tasks.

Merge Danger

Door: Two-way. The change keeps the existing storage layout and JSON format.

Blast Radius: Settings. Reserved settings keys now initialize file storage through the shared-state handlers. Other shared-state keys retain their current behavior.

@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 2:13pm UTC

This branch was previously deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant