Commit graph

7 commits

Author SHA1 Message Date
Johannes Millan
a276ccb3f4 fix: resolve pre-existing lint and prettier errors blocking commits (#6840) 2026-03-15 16:47:52 +01:00
Johannes Millan
a54de5f90d test(e2e): fix failing supersync E2E tests
- Wrong-password overwrite: remove Client A sync blocked by decrypt dialog
- Complex chain (4.1): rewrite without unreliable renameTask helper
- Delete vs Update race: fix assertions to expect delete wins
- Deleted task dueDay=today: same delete-wins fix, rename test
- Subtask conflicts: restructure so A marks done subtask from B
- Import tests: add syncImportChoice 'local' to preserve imported data
- Various other test fixes for reliability
2026-03-07 22:32:03 +01:00
Johannes Millan
f37280e082 refactor(sync): reduce MAX_VECTOR_CLOCK_SIZE from 30 to 20
Lower the cap to leave headroom for future increases and surface
size-related edge cases earlier. All pruning logic is MAX-agnostic
so this is a safe constant change with documentation updates.
2026-02-12 16:27:55 +01:00
Johannes Millan
c268b1a9a9 fix(sync): harden vector clock pruning and post-review sync fixes
Address issues found by code review agents after the LWW loop fix
(cb36c09538):

- Enforce MAX_VECTOR_CLOCK_SIZE on server upload to prevent oversized
  clocks from buggy/adversarial clients
- Limit aggregated snapshotVectorClock in download service to prevent
  unbounded growth with many clients
- Set UNKNOWN_OR_CHANGED status when LWW retry cap is exhausted instead
  of misleadingly reporting IN_SYNC
- Wrap startPostSyncCooldown() in try-catch so endApplyingRemoteOps()
  always runs even on failure
- Cap limitVectorClockSize output at MAX even when preserved IDs exceed
  the limit
- Update stale doc comments referencing MAX_VECTOR_CLOCK_SIZE=8 to 10
2026-01-30 18:40:54 +01:00
Johannes Millan
361d0e605f refactor(sync): rename "stale" to "superseded" across sync/operation domain
Includes backward compatibility: client accepts both CONFLICT_SUPERSEDED
and CONFLICT_STALE from the server, and the server keeps a deprecated
CONFLICT_STALE alias. Remove after all deployments are updated.
2026-01-30 16:59:40 +01:00
Johannes Millan
0781d44edb test(sync): add unit tests for setProtectedClientIds and improve E2E reliability
- Add 3 unit tests verifying setProtectedClientIds is called for
  SYNC_IMPORT and BACKUP_IMPORT, and not called for regular ops
- Fix inconsistent hideExpression patterns in sync-form.const.ts
  using safe field?.model access pattern
- Improve E2E test uniqueness with testRunId + timestamp + random suffix
- Increase error snackbar detection timeout from 2000ms to 5000ms
2026-01-25 20:18:31 +01:00
Johannes Millan
e6022cec77 test: add comprehensive tests for vector clock pruning fix
- Add E2E tests for SuperSync vector clock pruning scenarios:
  - Tasks created after receiving SYNC_IMPORT sync correctly
  - Multiple sync cycles after SYNC_IMPORT maintain consistency
- These tests verify the end-to-end flow that would fail without the fix

The E2E tests use the actual SuperSync server and verify that:
1. Client A imports backup (creates SYNC_IMPORT)
2. Client B receives import and creates new tasks
3. Client B's tasks sync back to Client A correctly
4. No sync errors occur (tasks aren't filtered incorrectly)
2026-01-25 19:41:35 +01:00