Commit graph

6 commits

Author SHA1 Message Date
Johannes Millan
44d7057129 fix(sync): only show import conflict dialog for local unsynced imports
The sync import conflict dialog was showing multiple times when it should
only show once, or not at all for already-accepted remote imports.

Root cause: The dialog trigger condition was too broad - it showed whenever
ALL downloaded ops were filtered by a SYNC_IMPORT, without distinguishing
between local unsynced imports (user needs to choose) and remote/synced
imports (old ops being silently cleaned up is expected behavior).

Changes:
- Add getLatestFullStateOpEntry() to get import with metadata (source, syncedAt)
- Add clearFullStateOps() for USE_REMOTE conflict resolution
- Return isLocalUnsyncedImport flag from SyncImportFilterService
- Pass through flag via RemoteOpsProcessingService
- Only show dialog when isLocalUnsyncedImport=true (local import not yet synced)
- Silently filter old ops when import was already accepted from remote
2026-01-11 11:22:32 +01:00
Johannes Millan
f37110bbb5 fix(e2e): improve test stability for parallel execution
SuperSync page object improvements:
- Add networkidle wait before interacting with sync dialog
- Add explicit mat-dialog-container wait before form interaction
- Add toBeAttached() assertions for element stability
- Use toPass() with progressive backoff for dropdown interactions
- Dismiss existing dropdown overlays before retrying
- Add blur() calls in password change dialog for Angular validation
- Add try-catch for fresh client dialog race condition

Task detail tests:
- Add blur() after time input fill to ensure Angular registers
  the change before clicking Save

These changes fix intermittent failures when running E2E tests
with multiple workers in parallel.
2026-01-04 17:35:47 +01:00
Johannes Millan
0b998459aa fix(e2e): fix failing tags test and flaky late-join test
- Tags test: Use right-click context menu approach instead of 'g' shortcut
  to avoid typing into editable task title
- Tags test: Add robust dismissAllOverlays helper with multiple Escape
  presses and backdrop click fallback
- Late-join test: Improve conflict dialog handling with retry loop and
  wait for dialog to close
- Late-join test: Add extra sync cycle after conflict resolution for
  more reliable data propagation
- All files: Fix incorrect port in warning messages (1900 -> 1901)

All 48 supersync e2e tests pass consistently.
2025-12-17 21:56:53 +01:00
Johannes Millan
cda5e1fe1f test(e2e): add task deletion sync test and improve documentation
- Add test for task deletion syncing between clients
- Document that scheduled task tests use dueDay, not actual repeat configs
- Reference integration tests for full repeat config sync testing
2025-12-17 18:24:19 +01:00
Johannes Millan
f51973ee92 fix(sync): update vector clock tests to expect error on overflow
Tests were expecting silent reset to 1 on overflow, but the implementation
correctly throws an error since resetting would break causality.
2025-12-15 20:00:58 +01:00
Johannes Millan
d6db1c2885 fix(sync): use timestamp comparison for same-millisecond UUIDv7 operations
When filtering operations after a SYNC_IMPORT, the previous string
comparison `op.id > latestImport.id` could incorrectly filter out
operations created in the same millisecond due to random bits in UUIDv7.

This caused repeatable task instances to not sync when created
immediately after an import operation.

Fix: Extract the 48-bit timestamp from UUIDv7 and use >= comparison
to ensure same-millisecond operations are kept.
2025-12-15 18:27:44 +01:00