fix(server-storage): keep tags with their values, rebase page-hide writes, hold deletes

- A re-read that keeps an entry from the cache (another tab's or this
  tab's unconfirmed value) no longer takes the server's tag for it, so the
  next edit conflicts and is replayed instead of overwriting another
  device's change.
- Page-hide writes behind a travelling one are taken from the queue when
  it is answered, so its new version becomes their baseline.
- A playlist delete holds that playlist's user-data edits instead of
  discarding them up front; only a successful delete drops them, a failed
  one sends them as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Opus 5.5 committed 2026-10-12 09:10:48 +02:00
1 parent 0183ddc61d
commit a8b6b86e43
7 files changed
+231 -57

No files matched your search

+5 -2
View File
@@ -215,8 +215,11 @@ settings and guards read them in every build.
as offline. Each write is sent on the tag of the entry it was made
against (`UserDataWriteQueue`); after a `412` the edit (before → after) is
replayed on the server's current value, so another device's change to the
same playlist's entry is kept. Deleting a playlist first drops its queued
edits and waits for writes still travelling. Edits made before the first successful read
same playlist's entry is kept. An entry a re-read keeps from the cache
gets no tag, so its next write conflicts and is replayed too. A page-hide
write behind a travelling one is taken from the queue only when that one
is answered. While a playlist is being deleted its edits wait; the
delete drops them only when it succeeds. Edits made before the first successful read
are held as before → after and applied to the server's value once it
arrives (`applyEdit`): a new device or a stale cache adds its favorite
instead of replacing the server's list. They are saved in the tab too