Repository navigation
Conversation
Removing a folder from mirroring trashes its files and drops their manifest baselines. If the files come back (restored, or a folder removed and re-added), the mirror saw local files with no baseline and flagged every one as "Protected local edit" — 0 downloaded, 0 unchanged, stuck. Now mirrorFile adopts an untracked local file when its md5 matches the Cloud file: it records the manifest baseline and reports the file unchanged instead of protecting it, with no re-download. Genuinely divergent untracked files are still protected, and a tracked local edit is still protected before any cloud round-trip.
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.
Fix: adopt untracked local files that match the Cloud on mirror
When mirroring, a local file that isn't tracked in the sync manifest but whose content matches the Cloud file (same md5) previously raised a "Protected local edit" error and stalled the sync. This happens after removing and re-adding a synced folder, or on a fresh device that already has the files.
The mirror now adopts such files (records the manifest baseline, no download, no vault write) instead of erroring. Tracked local edits that diverge from their baseline are still protected before any cloud round-trip — that distinction is unchanged.
Test plan:
pnpm test— two new tests: "adopts an untracked local file that matches the Cloud" and "still protects an untracked local file that differs"; full suite green.Extracted from the Supernote Sync & Transcribe fork.