Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions e2e/features/conflict-resolution.feature
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
@mobilesync @conflict
Feature: Conflict Resolution - Mobile and Desktop concurrent edits
Feature: Conflict Resolution - Mobile and mock server concurrent edits

# Pre-condition: At least one wiki workspace exists with E2ETestTiddler.tid in its git history.
# Run @import and @sync scenarios first to ensure the shared ancestor commit exists.
#
# The conflict flow:
# 1. Desktop modifies E2ETestTiddler.tid body + commits (via file-system watcher auto-commit).
# 2. Mobile modifies the SAME file differently (via adb) — diverged commit from the same ancestor.
# 3. Mobile taps sync: gitCommit → gitPushToIncoming → triggerDesktopMerge → gitFetchAndReset.
# 4. Desktop detects merge conflict → resolveTidConflictMarkers resolves it:
# 1. Scenario imports a fresh mock wiki and creates E2ETestTiddler.tid.
# 2. Mock server modifies E2ETestTiddler.tid body + commits explicitly.
# 3. Mobile modifies the SAME file differently (via adb) — diverged commit from the same ancestor.
# 4. Mobile taps sync: gitCommit → gitPushToIncoming → plugin merge → gitFetchAndReset.
# 5. Plugin detects merge conflict → resolveTidConflictMarkers resolves it:
# header: mobile wins (newer modified timestamp)
# body: desktop + unique mobile lines merged
# 5. Verify: desktop file contains BOTH body lines; mobile sync completes successfully.
# body: mock server + unique mobile lines merged
# 6. Verify: mock server file contains BOTH body lines; mobile sync completes successfully.

Background:
Given the app is on the main menu screen
And at least one wiki workspace exists

@conflict
Scenario: Body edits on both sides are merged; mobile header wins on conflict
# Desktop adds a unique body line to E2ETestTiddler.tid and waits for file-watcher auto-commit.
Given a fresh mock server wiki is imported
And the imported mock server wiki has a synced tiddler "E2ETestTiddler" in shared history
# Mock server adds a unique body line to E2ETestTiddler.tid and commits explicitly.
# Mobile independently overwrites the same tiddler with a different body line.
# After sync, both body lines must be present and mobile's modified timestamp must win.
Given the desktop appends "Desktop conflict line." to "E2ETestTiddler.tid" and commits
Given the mock server appends "Mock server conflict line." to "E2ETestTiddler.tid" and commits
When the mobile overwrites "E2ETestTiddler.tid" adding body line "Mobile conflict line."
And I tap the sync button for the first wiki workspace
Then the sync should complete successfully
And the mock server desktop git runner should be used
And the unsynced count should be zero after sync
And the desktop tiddler "E2ETestTiddler.tid" body contains "Desktop conflict line."
And the desktop tiddler "E2ETestTiddler.tid" body contains "Mobile conflict line."
And the desktop tiddler "E2ETestTiddler.tid" header contains the mobile modified timestamp
And the mock server tiddler "E2ETestTiddler.tid" body contains "Mock server conflict line."
And the mock server tiddler "E2ETestTiddler.tid" body contains "Mobile conflict line."
And the mock server tiddler "E2ETestTiddler.tid" header contains the mobile modified timestamp
Loading
Loading