Encryption: two follow-ups from the #153 review #238

closed cmc opened this on 2026-11-26 10:40 UTC · feature · milestone 5 Sync and files

Discussion

cmc 2026-11-26 10:40 UTC

Low-severity items left after the review of #153 (MR 489); neither puts plaintext on disk.

  1. The restore of another app's version can overwrite a third version. DocumentSession.closedFileSaver → restoreOverwritten calls disk.replace(url, with: theirs) without checking what is on disk at that moment. If a third write lands after our replace and before the restore (a window of microseconds), the restore overwrites it and it isn't kept in recovery. Fix: read the disk first and restore only when it still holds the bytes we wrote; otherwise leave the newer version and still fail.

  2. Hidden clock tasks can drop out of history. On a launch where the Keychain can't be read (for example an iOS launch before first unlock, when the watch wakes the app), the run hashes titles with a session key, so earlier hidden tasks without an ID can't be matched; ClockHistory.push drops them and the next save makes it permanent. No text is exposed. Fix: when the key isn't available, keep history entries that have a stored hash unchanged instead of refreshing them away.

Platforms: Mac, iOS.

closed by cmc in commit 9300add1d8: Restore only over our own write; keep hidden clock tasks without the key

2026-11-26 11:38 UTC
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form