Files
Chronos/tests/Chronos.Data.Tests/Sync
Alby96andClaude Opus 5.5 4d697a4255 feat: stable server id and per-home folder layout (owner review 5 P3.1)
The desktop keyed every server by the address it was reached at, so one
NAS reached by name and by IP, or after an address change, looked like two
servers, and all servers shared one workspace and one cache. Each server
now announces a stable id, and the desktop's folders are sorted into one
home per server, so that every server can have its own archive of
downloaded originals (or5 answers Q1).

- The server makes a Guid v7 once, keeps it as the app setting server.id
  (so it survives restarts and restores, on SQLite and Postgres) and
  announces it as ServerInfo.ServerId. Older clients ignore the field, and
  older servers read as null.
- ServerIdentity keys a server as id:<N> when it announces an id, and by
  its address otherwise. Address keys are kept as aliases.
- HomeFolders names the homes: local, servers/<id> or
  servers/addr-<hash16>. The hash equals the 1.0 proxy cache folder name.
  It also names the per-server originals archive root.
- WorkspaceHomes splits the workspace into one format-1 store per home
  under a format-2 parent manifest, which 1.0 refuses. A 1.0 workspace
  stays one store until it is sorted.
- HomeLayoutMigration plans as a dry run and applies through a journal:
  - only same-folder renames, each checked by inventory;
  - a clash keeps the copy saved last and sends the other to the trash;
  - it resumes after a crash at any step;
  - it skips leased projects;
  - it defers an offline workspace or one being moved, while the cache
    part still runs.
- RekeyAsync moves an alias home to the id home: whole folders, or
  project-by-project merges. It also rewrites working states under their
  lease, and moves sync_links (the newer row wins a clash).
- ProxyCache, the job root resolver, WorkspaceMover and WorkspaceCleaner
  understand the split layout. The new layout is opt-in through
  SyncOptions.ServersDirectory, so the app sees no change until it is
  wired.

Refs #66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:15:11 +01:00
..