Commit graph

8 commits

Author SHA1 Message Date
Lukas Brübach
f9ad700f3c Fix ZeldaZach review for PR 7494: match by remoteId/guid before remote-delete, only tombstone when file truly missing 2026-11-07 23:49:22 +01:00
Lukas Brübach
fe9f5ad098 [Server+Client] Tombstone deck deletes with purge and base snapshots 2026-11-07 23:49:22 +01:00
Lukas Brübach
997eee835e [DeckSync] Match server rows by identity and hash the whole deck
Sync keyed local files to server rows by path, but the server names a row
after the deck, not after the file, so any deck whose file name and deck name
differ uploaded again on every run. A second pass then brought the server copy
back as an extra local file.

- Match by the sidecar's row id, then guid, then content, and only then by the
  server path, so renaming either side no longer duplicates a deck.
- Key the server tree by row id: the server allows several rows with the same
  name in one folder, and keying by path silently dropped all but one.
- Stop discarding rows whose name contains '/' ("U/W Control"). They stay
  matchable, and only the download file name is sanitised.
- Build the download path from the folder plus a sanitised row name, including
  every folder segment, so a hostile server name cannot escape the deck folder.
- Download a colliding server row under a unique name and count it, instead of
  skipping it without a trace.
- Hash the whole deck instead of the card hash: SHA-1 over the native deck
  string covers name, printings, banner, tokens and sideboard plans. The client
  and the server hash the exact bytes they exchange, so both agree.

Adds deck_content_hash_test for the client/server hashing invariant and for the
name-only change the card hash cannot see.
2026-11-07 23:49:18 +01:00
Lukas Brübach
cc89c32191 [DeckSync] Pass the sync summary through the signal and tidy the manager API
- Emit SyncSummary from syncFinished() instead of four positional ints, and
  build it from a single currentSummary() helper, so the counts cannot drift
  between the status message and the signal.
- Use a designated initializer for LocalFile, like the other records.
- Drop setClient() and setColorIdentityProvider(): both fields are already
  constructor parameters and the setters had no callers. setProfile() and
  setDeckPath() stay, since the tab re-reads them before every run.
- Fix the include paths in tab_deck_storage.h and the narrowing conversion of
  the tree item id, so the branch builds again.
2026-11-07 23:49:18 +01:00
BruebachL
c2a1508a2e [DeckSync] Use designated initializer for ServerFile per review 2026-11-07 23:48:56 +01:00
BruebachL
2db9760170 [DeckSync] Prefer ctor params for set-once client/provider per review 2026-11-07 23:48:56 +01:00
Lukas Brübach
1cac2ae7b2 Fix ZeldaZach review for PR 7493: match uploads by sidecar remoteId/guid, validate server paths 2026-11-07 23:24:52 +01:00
Lukas Brübach
53c15b1298 [Client] Manual deck collection sync with Sync Now action 2026-11-07 23:24:52 +01:00