super-productivity/e2e
Johannes Millan ee5037a33d fix(sync): upload full state snapshot on server migration
When a client with existing data connects to a new/empty server (e.g.,
switching sync URLs or migrating to self-hosted), the server returns
gapDetected: true. Previously, the client would only upload incremental
operations, causing data loss for other clients since those ops
reference entities that don't exist on the new server.

Now when gap is detected AND the server is empty:
1. Download service sets needsFullStateUpload flag in DownloadResult
2. Sync service creates a SYNC_IMPORT operation with full current state
3. This operation is uploaded via the snapshot endpoint before regular ops

Changes:
- Add needsFullStateUpload to DownloadResult interface
- Add server migration detection in _downloadRemoteOpsViaApi()
- Add _handleServerMigration() method to create SYNC_IMPORT operation
- Add _isEmptyState() helper to skip when local state is empty
- Add E2E and integration tests for server migration scenarios
- Enhance MockSyncServer with gap detection support
2025-12-12 20:48:40 +01:00
..
constants refactor(e2e): improve test reliability with deterministic waits 2025-12-11 18:47:56 +01:00
fixtures fix(e2e): reduce console log noise with optional E2E_VERBOSE flag 2025-12-12 20:48:13 +01:00
helpers test: make e2e less flaky 2025-11-14 15:43:22 +01:00
pages fix(sync): support encrypted payloads in server validation and e2e 2025-12-12 20:48:13 +01:00
tests fix(sync): upload full state snapshot on server migration 2025-12-12 20:48:40 +01:00
utils fix(e2e): reduce console log noise with optional E2E_VERBOSE flag 2025-12-12 20:48:13 +01:00
.gitignore build(ci): resolve e2e webserver timeout issues 2025-08-03 12:36:02 +02:00
global-setup.ts test(e2e): remove console.log statements and replace console.error with throw 2025-08-02 12:25:21 +02:00
playwright.config.ts test(e2e): try to fix e2e tests 2025-12-10 21:26:48 +01:00
tsconfig.json refactor: move tests 2025-08-02 11:37:25 +02:00