mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-28 18:20:42 +00:00
Added extensive test coverage to prevent regression of the password change + gap detection bug: **Unit Tests - operation-log-download.service.spec.ts (38 tests, +3 new):** 1. "should re-fetch encryption key after gap detection for password change scenario" - Simulates Client A password change → gap → Client B re-download - Verifies getEncryptKey() called twice (initial + after gap) - Ensures decryption uses NEW password after gap 2. "should handle gap detection and fetch updated encryption key" - Tests key is re-fetched when gap occurs - Verifies different passwords are used before/after gap 3. "should use updated encryption key even when no gap but key changed" - Tests normal flow isn't broken by the fix - Ensures correct password is always used for decryption 4. "should re-fetch key on gap even when encryption was disabled then enabled" - Edge case: encryption disabled → enabled during gap - Verifies undefined → password transition works **Unit Tests - encryption-password-change.service.spec.ts (19 tests, +3 new):** 1. "should upload clean slate with isCleanSlate=true flag" - Verifies server receives flag to delete all old encrypted data - This deletion triggers gap detection on other clients 2. "should clear derived key cache twice on upload failure" - Tests cache clearing on both password change AND revert - Prevents stale cached keys for either password 3. "should generate new client ID via clean slate" - Confirms clean slate creates new client ID - Explains why this prevents vector clock conflicts **E2E Test - supersync-encryption-password-change.spec.ts (+1 new):** 1. "Error dialog recovery: entering new password after change works" - Full end-to-end test of the bug scenario - Client A changes password → Client B syncs with old password - Client B gets decrypt error → enters new password in dialog - Verifies sync succeeds with new password after gap detection - Tests bidirectional sync works after recovery These tests ensure: - Encryption key is always re-fetched after gap detection - Password changes via error dialog work correctly - Gap detection properly triggers key refresh - Cache invalidation works in all scenarios - Clean slate mechanism triggers gap detection as expected Total new test coverage: 7 unit tests + 1 E2E test |
||
|---|---|---|
| .. | ||
| ENCRYPTION-E2E-STATUS.md | ||
| import-sync.spec.ts | ||
| supersync-account-deletion.spec.ts | ||
| supersync-account-reset.spec.ts | ||
| supersync-advanced-edge-cases.spec.ts | ||
| supersync-advanced.spec.ts | ||
| supersync-archive-data-sync.spec.ts | ||
| supersync-archive-subtasks.spec.ts | ||
| supersync-backup-import-id-mismatch.spec.ts | ||
| supersync-backup-recovery.spec.ts | ||
| supersync-cross-entity.spec.ts | ||
| supersync-daily-summary.spec.ts | ||
| supersync-edge-cases.spec.ts | ||
| supersync-encryption-enable-disable.spec.ts | ||
| supersync-encryption-password-change.spec.ts | ||
| supersync-encryption.spec.ts | ||
| supersync-error-handling.spec.ts | ||
| supersync-import-clean-slate.spec.ts | ||
| supersync-import-conflict-dialog.spec.ts | ||
| supersync-import-encryption-change.spec.ts | ||
| supersync-late-join.spec.ts | ||
| supersync-legacy-migration-sync.spec.ts | ||
| supersync-lww-conflict.spec.ts | ||
| supersync-models.spec.ts | ||
| supersync-network-failure.spec.ts | ||
| supersync-planner.spec.ts | ||
| supersync-repeat-task-advanced.spec.ts | ||
| supersync-repeat-task.spec.ts | ||
| supersync-server-migration.spec.ts | ||
| supersync-simple-counter.spec.ts | ||
| supersync-snapshot-vector-clock.spec.ts | ||
| supersync-stale-clock-regression.spec.ts | ||
| supersync-stress.spec.ts | ||
| supersync-task-ordering.spec.ts | ||
| supersync-time-tracking-advanced.spec.ts | ||
| supersync-worklog.spec.ts | ||
| supersync-wrong-password-error.spec.ts | ||
| supersync.spec.ts | ||
| webdav-first-sync-conflict.spec.ts | ||
| webdav-legacy-migration-sync.spec.ts | ||
| webdav-provider-switch.spec.ts | ||
| webdav-sync-advanced.spec.ts | ||
| webdav-sync-archive.spec.ts | ||
| webdav-sync-delete-cascade.spec.ts | ||
| webdav-sync-error-handling.spec.ts | ||
| webdav-sync-expansion.spec.ts | ||
| webdav-sync-full.spec.ts | ||
| webdav-sync-tags.spec.ts | ||
| webdav-sync-task-order.spec.ts | ||
| webdav-sync-today-tag.spec.ts | ||