Conflict Resolution
Handling Edit Conflicts
When you edit the same note on multiple devices before syncing, Strayfiles detects the conflict and helps you resolve it.
How Conflicts Happen
Timeline:
1. Note at version 3 on all devices
2. MacBook edits → local version 4
3. iMac edits → local version 4 (conflict!)
4. MacBook syncs first → server has version 4
5. iMac tries to sync → version mismatch detected
The iMac expected to update version 3, but found version 4 instead.
Conflict Detection
Strayfiles uses optimistic concurrency:
- Each note has a
version_number - When you save, you send: “Update version N to N+1”
- If server has version > N, conflict detected
- Both versions preserved for resolution
What’s Stored
When a conflict occurs, Strayfiles saves:
| Field | Description |
|---|---|
| Base content | Common ancestor (version both started from) |
| Local content | What you tried to save |
| Remote content | Current version on the server |
| Base version | Version number of common ancestor |
| Local version | Your expected version |
| Remote version | Actual current version |
| Device IDs | Which devices made each change |
Storage location:
- Local backends: Content stored in files at
~/.strayfiles/conflicts/{id}/ - Supabase: Content stored in database for Stray Cloud
Conflict tracking requires the Redb backend (default). Memory and Git backends don’t support conflict tracking.
Resolution Strategies
Keep Local: Use your version, discard the remote changes.
Keep Remote: Use the other device’s version, discard your changes.
Auto-Merge: Attempt automatic 3-way merge using the base as common ancestor.
3-Way Merge
Auto-merge works when changes don’t overlap:
Base: "Hello world"
Local: "Hello world!" (added punctuation)
Remote: "Hello beautiful world" (added adjective)
Merged: "Hello beautiful world!" (both changes)
Merge fails when changes conflict:
Base: "Hello world"
Local: "Hi world"
Remote: "Hello earth"
Result: Cannot auto-merge (same section changed differently)
Resolving Conflicts
- Open the note (conflict indicator shown)
- Click “Resolve Conflict”
- See side-by-side comparison:
- Left: Your version
- Right: Their version
- Bottom: Base version
- Choose resolution:
- “Keep Mine”
- “Keep Theirs”
- “Auto-Merge” (if available)
- Manual edit (copy parts from each)
Conflict Indicators
Notes with unresolved conflicts show:
- Warning icon in note list
- Banner at top of note
- Sync status shows “Conflict”
Preventing Conflicts
Sync frequently: Smaller, more frequent syncs reduce conflict chances.
Avoid simultaneous edits: If you know you’ll edit on multiple devices, sync first.
Use different notes: For parallel work, consider separate notes that merge later.
Device Attribution
Conflict view shows which device made each change:
Your changes (MacBook Pro):
+ Added new section on API
Their changes (iPhone):
+ Fixed typo in introduction
This context helps decide which version to keep.
Conflict History
Resolved conflicts are logged for audit purposes:
- Original conflict details preserved
- Resolution method recorded
- Timestamp of resolution
- Can view past conflicts in note history
Advanced: Manual Resolution
For complex conflicts:
- Choose “Keep Mine” or “Keep Theirs”
- Copy the other version’s content you want
- Manually merge in the editor
- Save creates new clean version
Folder Sync Conflicts
When using iCloud/Dropbox (not Pro sync):
- Conflicts handled by the sync provider
- Creates “conflicted copy” files
- Strayfiles shows both files
- Manually merge and delete duplicate
Tips
Check for conflicts after offline work: Syncing after being offline may surface conflicts.
Auto-merge is safe: It only succeeds when changes don’t overlap. Overlapping changes require manual resolution.
When in doubt, keep both: Copy content from both versions before resolving.