Repository navigation
fix(desktop): Sublime saves show in readm3 at once, even over a synced copy - #82
Merged
Merged
Conversation
… synced copy The desktop app now watches the folders of the files it opened and tells the page which file changed, so a save in Sublime reaches readm3 immediately instead of on a 5 s poll that stops while the window is hidden. A disk file whose copy came from sync (another device's version) counted as 'unsaved edits', so every later save on disk was ignored for good. Only typing in readm3 now holds the disk back; a sync copy is replaced by the disk version and kept in History. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Anthony: a file in ~/Desktop saved in Sublime did not update in the readm3 desktop app; it looked like a cached copy. Local files should update in real time; copies are only for cloud sync.
Two causes
checkDiskFiletreated "the copy differs from disk" as "you have unsaved edits". A copy that sync brought from another device also differs from disk, so every later Sublime save was put in History and never loaded.Fix
desktop/main.cjswatches the parent folder of every opened file (the folder, because rename-over saves end a watch on the file itself; at most 2000 folders, most recent first) and sendsfiles-changedonce the events stop.preload.cjsexposesonFilesChanged.site/viewer.tschecks reported files at once, even with the window hidden, through one queue shared with the poll. Only typing in readm3 (typedHere, kept across restarts) holds back a change on disk. A copy that differs only because of sync is replaced by the disk version and recorded in History as "replaced by disk".Test: new viewer.spec
a save in another editor shows at once, even over a copy sync brought. It reloads within 2 s without focus, replaces a sync-applied copy, and keeps typed edits. This box is low on memory, so I could only run the e2e specs one at a time; the desktop specs and unit tests pass. The sync specs crash the browser here on untouched main too, so CI decides.Versions: npm 0.28.0, desktop 0.20.0 (needs the new desktop build; there is no auto-updater).
🤖 Generated with Claude Code