mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-28 18:20:42 +00:00
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 |
||
|---|---|---|
| .. | ||
| constants | ||
| fixtures | ||
| helpers | ||
| pages | ||
| tests | ||
| utils | ||
| .gitignore | ||
| global-setup.ts | ||
| playwright.config.ts | ||
| tsconfig.json | ||