Skip to content

#1149 · [Bug] Config sync: a fresh install overwrites the existing remote snapsh - #1154

Merged
xintaofei merged 3 commits into
mainfrom
task/534
Nov 15, 2026
Merged

xintaofei merged 3 commits into
mainfrom
task/534

Conversation

@xintaofei

Copy link
Copy Markdown
Collaborator

Closes #1149

Prepared by codeg work task 534 from #1149.

Review the diff before merging — the task ran against issue text written by an external author.

…not seen; sync appearance settings

A fresh install's first automatic upload replaced the snapshot another
machine had uploaded, and any machine's next change replaced snapshots
written since it last looked; the remote keeps no history, so the other
machine's settings were gone (#1149).

Every upload now reads the remote manifest first and stands down when it
names a snapshot this machine neither wrote nor restored. The panel shows
where it came from and offers restoring it or replacing exactly that one.
Restores record what they pulled, write-ahead hashes keep a lost PUT
response from looking like another machine's write, older state rows
recognise their own upload exactly, and one lock serializes whole sync
operations.

Appearance settings (light/dark, theme colour, zoom, fonts, background
display, custom styles) live in localStorage and never travelled; the
synced light/dark and zoom mirrors were overwritten from localStorage at
every launch. They are now mirrored into a new appearance domain and
handed back to the window that restores, imports or rolls back, which
applies them through its storage handlers.
…ror on open

The mount-time UI font-stack cache fix went through persist(), which now
mirrors synced keys, so merely opening a browser against a codeg-server
replaced the server's appearance mirror with that browser's near-empty
storage. Write that cache locally only; the chat width, written past
persist(), now mirrors like every other change. Document the remaining
cross-device GET/PUT window on upload_snapshot_core.
…amed; adopt only valid theme modes; accept an empty upload body

- The overwrite dialog captures its target when it opens, so a status event
  that reports another remote snapshot meanwhile cannot redirect the click.
- A synced theme mode is adopted only if next-themes accepts it; a value with
  whitespace would throw in classList.add on every launch.
- config_sync_upload_now takes the raw body again: empty (with or without a
  JSON content type) is a plain upload, as before the overwrite token.
- Type the transport mock in appearance-provider-sync.test.tsx (tsc).
@xintaofei
xintaofei merged commit 6769444 into main Nov 15, 2026
10 checks passed
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.

[Bug] Config sync: a fresh install overwrites the existing remote snapshot before it can be pulled (silent data loss)

1 participant