super-productivity/e2e/tests/sync
Johannes Millan 63253f8e0c
fix(sync): never transmit plaintext operations for E2EE-mandatory providers (#8670)
* fix(sync): never upload plaintext ops for E2EE-mandatory providers

SuperSync's first-time setup ran an initial sync (dialog-sync-cfg save ->
sync(true)) BEFORE the user chose an encryption password, so all local ops
(incl. issue-provider credentials) were uploaded to the server in cleartext.
Completing setup deleted them; aborting left them stored indefinitely, breaking
the E2EE promise (GHSA-9v8x-68pf-p5x7).

Add an optional `isEncryptionMandatory` capability to OperationSyncCapable
(true for SuperSync) and refuse to upload in the op-log upload path while no
usable key is configured. Downloads still run (merge-first) and the encryption-
enable flow performs the first, encrypted upload, so the setup flow and prompt
are unchanged. File-based providers, where unencrypted sync is a legitimate
user choice, leave the flag unset.

* fix(sync): fail closed on plaintext snapshot for E2EE-mandatory providers

Multi-review hardening for GHSA-9v8x-68pf-p5x7. The op-upload guard closes the
reported leak, but SnapshotUploadService.deleteAndReuploadWithNewEncryption could
still push a plaintext snapshot for SuperSync on two adjacent paths: the (today
UI-unreachable) disable-encryption flow, and a keyless import declaring
isEncryptionEnabled:true. Reject an unencrypted snapshot for an encryption-
mandatory provider before any destructive deleteAllData, so the "never transmit
plaintext" invariant holds regardless of caller.

Also lower the mandatory-encryption upload-skip log from warn to normal: it is an
expected by-design skip during the pre-encryption setup window and would
otherwise fire on every auto-sync cycle.

* fix(sync): consolidate op-log into the encryption-enable snapshot

Follow-up to the GHSA-9v8x-68pf-p5x7 upload guard. With the guard, first-time
SuperSync setup leaves the whole local history unsynced until encryption is
enabled; the enable-snapshot then represents that full state, but the ops were
re-uploaded incrementally on top of it on the next sync (redundant server op-log
bloat, and previously untested at whole-history volume).

deleteAndReuploadWithNewEncryption now captures the pending ops the snapshot
subsumes (before the destructive delete, under runWithSyncBlocked + a modal
dialog so the set is stable) and marks them synced after a successful upload —
mirroring planRegularOpsAfterFullStateUpload in the op-log upload path, which
this direct snapshot upload bypasses. Also fixes the same latent redundancy in
the enable-from-settings-with-pending-ops flow.

Adds a multi-client e2e: local task history exists before first-time encrypted
setup, then a second client with the same password receives exactly those tasks
with no duplicates, conflicts, or errors.

* ci(e2e): add optional grep input to manual SuperSync e2e dispatch

* fix(sync): capture subsumed ops before state snapshot to prevent mark-synced data loss

deleteAndReuploadWithNewEncryption captured getUnsynced() AFTER the full-state
snapshot, so an op created in that window was marked synced yet absent from the
snapshot — silently lost. Capture the unsynced set first: every marked-synced op
is then guaranteed present in the snapshot, and a concurrent op arriving after
the capture is left unsynced and re-uploaded next sync (idempotent by op id).

* test(sync): mock WebCrypto so mandatory-encryption guard test reaches the guard

The 'enabling without a usable key' case passed isEncryptionEnabled: true but did
not mock WebCrypto, so the availability check threw WebCryptoNotAvailableError in
non-secure CI before the /unencrypted snapshot/ guard under test.
2026-07-01 17:56:39 +02:00
..
ENCRYPTION-E2E-STATUS.md refactor(sync): consolidate LegacySyncProvider into SyncProviderId 2026-02-15 11:19:22 +01:00
import-sync.spec.ts feat(history): merge Quick History and Worklog into a unified History view (#8033) 2026-06-05 18:10:56 +02:00
supersync-account-deletion.spec.ts fix(e2e): fix failing and flaky supersync tests 2026-02-08 14:16:06 +01:00
supersync-account-reset.spec.ts test(sync): add encryption and supersync e2e test coverage 2026-03-01 21:27:08 +01:00
supersync-advanced-edge-cases.spec.ts fix(e2e): add settle time after done-toggle to prevent sync race condition 2026-03-24 20:09:02 +01:00
supersync-advanced.spec.ts fix(sync): preserve own vector clock counter across full-state op resets 2026-04-01 15:41:13 +02:00
supersync-archive-conflict.spec.ts test(e2e): harden LWW archive and encryption password-change tests 2026-04-19 19:20:34 +02:00
supersync-archive-data-sync.spec.ts feat(history): merge Quick History and Worklog into a unified History view (#8033) 2026-06-05 18:10:56 +02:00
supersync-archive-subtasks.spec.ts Codex/issue 8081 keep subtask input open (#8423) 2026-06-18 17:58:45 +02:00
supersync-backup-import-id-mismatch.spec.ts test(e2e): tighten backup-export selector for renamed privacy button 2026-04-21 21:50:52 +02:00
supersync-backup-recovery.spec.ts feat(history): merge Quick History and Worklog into a unified History view (#8033) 2026-06-05 18:10:56 +02:00
supersync-cascade-delete.spec.ts test(e2e): fix reliability issues in supersync E2E tests 2026-02-13 14:06:43 +01:00
supersync-compaction.spec.ts chore(e2e): remove unused eslint-disable directive 2026-02-12 16:43:11 +01:00
supersync-concurrent-delete-reorder.spec.ts fix(sync): improve move operation reliability during sync 2026-03-24 16:25:42 +01:00
supersync-concurrent-import.spec.ts test(e2e): fix supersync E2E tests for mandatory encryption flow 2026-03-06 16:36:38 +01:00
supersync-constraint-error-recovery.spec.ts fix(tests): improve synchronization tests and increase timeout for IndexedDB operations 2026-02-06 20:10:21 +01:00
supersync-cross-entity.spec.ts fix(e2e): improve test stability for parallel execution 2026-01-04 17:35:47 +01:00
supersync-daily-summary.spec.ts test(e2e): retry supersync time-estimate dialog until input binds 2026-06-09 13:56:15 +02:00
supersync-day-change-overdue-6992.spec.ts test(e2e): add day-change sync convergence test (#6992) and fix lint 2026-03-29 19:57:10 +02:00
supersync-divergence-bug-6571.spec.ts fix(sync): preserve own vector clock counter across full-state op resets 2026-04-01 15:41:13 +02:00
supersync-edge-cases.spec.ts test(e2e): fix done-toggle selector to use element instead of class 2026-03-24 16:25:42 +01:00
supersync-encryption-conflict.spec.ts test(e2e): fix done-toggle selector to use element instead of class 2026-03-24 16:25:42 +01:00
supersync-encryption-password-change.spec.ts test(sync): cover incompatible supersync password change 2026-05-13 11:08:54 +02:00
supersync-encryption-password-preservation.spec.ts test(e2e): fix supersync E2E tests for mandatory encryption flow 2026-03-06 16:36:38 +01:00
supersync-encryption.spec.ts fix(sync): never transmit plaintext operations for E2EE-mandatory providers (#8670) 2026-07-01 17:56:39 +02:00
supersync-error-handling.spec.ts test(e2e): fix done-toggle selector to use element instead of class 2026-03-24 16:25:42 +01:00
supersync-error-scenarios.spec.ts test(e2e): fix supersync error scenario tests and skip failing import tests 2026-03-06 23:08:37 +01:00
supersync-example-task-fresh-client.spec.ts [codex] Fix sync import conflict from startup example tasks (#7976) 2026-06-03 15:57:53 +02:00
supersync-global-config-edge-cases.spec.ts test(e2e): strengthen assertions in supersync E2E tests 2026-02-12 16:42:07 +01:00
supersync-import-clean-server-state.spec.ts test(e2e): fix supersync error scenario tests and skip failing import tests 2026-03-06 23:08:37 +01:00
supersync-import-clean-slate.spec.ts test(e2e): fix 11 failing supersync import tests 2026-03-07 13:28:20 +01:00
supersync-import-conflict-dialog.spec.ts fix(sync): persist lastServerSeq after piggybacked ops are applied (#8304) (#8372) 2026-06-13 14:22:23 +02:00
supersync-import-encryption-change.spec.ts test(e2e): fix 11 failing supersync import tests 2026-03-07 13:28:20 +01:00
supersync-import-encryption-preserve.spec.ts test(e2e): fix 11 failing supersync import tests 2026-03-07 13:28:20 +01:00
supersync-import-other-client-ops.spec.ts test(e2e): fix reliability issues in supersync E2E tests 2026-02-13 14:06:43 +01:00
supersync-import-same-client-ops.spec.ts test(e2e): fix reliability issues in supersync E2E tests 2026-02-13 14:06:43 +01:00
supersync-keep-local-archive-preservation.spec.ts feat(history): merge Quick History and Worklog into a unified History view (#8033) 2026-06-05 18:10:56 +02:00
supersync-lastseq-preservation.spec.ts test(e2e): fix reliability issues in supersync E2E tests 2026-02-13 14:06:43 +01:00
supersync-late-join.spec.ts test(e2e): fix failing supersync E2E tests 2026-03-07 22:32:03 +01:00
supersync-legacy-migration-sync.spec.ts Improve on sync (#7736) 2026-05-22 17:49:25 +02:00
supersync-lww-conflict.spec.ts Codex/issue 8081 keep subtask input open (#8423) 2026-06-18 17:58:45 +02:00
supersync-lww-singleton.spec.ts style: fix prettier formatting errors in e2e tests and nav-item scss 2026-04-01 15:41:14 +02:00
supersync-max-retry-rejection.spec.ts test(e2e): fix failing supersync E2E tests 2026-03-07 22:32:03 +01:00
supersync-models.spec.ts test(e2e): fix failing sync tests and reduce flakiness 2026-03-27 17:33:38 +01:00
supersync-multi-tab.spec.ts feat(shepherd): remove all tours except keyboard navigation 2026-03-22 17:00:42 +01:00
supersync-network-failure.spec.ts test(supersync): fix flaky E2E tests with timing adjustments 2026-01-24 21:14:57 +01:00
supersync-no-op-sync.spec.ts test(sync): add encryption and supersync e2e test coverage 2026-03-01 21:27:08 +01:00
supersync-planner.spec.ts fix(e2e): improve test stability for parallel execution 2026-01-04 17:35:47 +01:00
supersync-provider-switch-to-supersync.spec.ts test(sync): add encryption and supersync e2e test coverage 2026-03-01 21:27:08 +01:00
supersync-provider-switch.spec.ts test(e2e): fix reliability issues in supersync E2E tests 2026-02-13 14:06:43 +01:00
supersync-realtime-push.spec.ts test(e2e): block WebSocket in SuperSync tests to prevent sync race conditions 2026-03-30 23:14:01 +02:00
supersync-reenable-and-account-switch.spec.ts test(sync): add encryption and supersync e2e test coverage 2026-03-01 21:27:08 +01:00
supersync-rejected-ops-transient-download-8331.spec.ts test(sync): unblock #8331 e2e by stripping conflict-response piggyback 2026-06-13 17:36:16 +02:00
supersync-repeat-task-advanced.spec.ts fix(e2e): improve test stability for parallel execution 2026-01-04 17:35:47 +01:00
supersync-repeat-task.spec.ts fix(sync): only show import conflict dialog for local unsynced imports 2026-01-11 11:22:32 +01:00
supersync-server-backup-revert.spec.ts chore(task-repeat): revert RRULE Phase 1 from master (#7948) Develop the full RFC-5545 RRULE epic on the long-running feat/rrule-epic branch and merge once complete and testable in final form, rather than landing 13 phases into master one half-state at a time. Work preserved on feat/rrule-epic. Not yet shipped (post-v18.9.1), so no user impact. 2026-06-09 13:56:38 +02:00
supersync-server-migration-abort.spec.ts test(sync): add encryption and supersync e2e test coverage 2026-03-01 21:27:08 +01:00
supersync-server-migration.spec.ts test(e2e): add sync-stall recovery to flaky supersync setup and migration 2026-05-28 13:58:19 +02:00
supersync-simple-counter-delete-update-7330.spec.ts fix(op-log): backfill SIMPLE_COUNTER fields on LWW recreate (#7330) (#8646) 2026-06-30 15:40:25 +02:00
supersync-simple-counter.spec.ts test(e2e): fix supersync E2E tests for mandatory encryption flow 2026-03-06 16:36:38 +01:00
supersync-snapshot-vector-clock.spec.ts test(e2e): scope supersync backup-revert DB restore to test user 2026-06-01 16:33:18 +02:00
supersync-stress.spec.ts test(e2e): fix done-toggle selector to use element instead of class 2026-03-24 16:25:42 +01:00
supersync-superseded-clock-regression.spec.ts test(e2e): fix failing supersync E2E tests 2026-03-07 22:32:03 +01:00
supersync-task-ordering.spec.ts fix(e2e): stabilize flaky supersync tests with better waiting strategies 2026-01-13 18:26:45 +01:00
supersync-time-tracking-advanced.spec.ts feat(history): merge Quick History and Worklog into a unified History view (#8033) 2026-06-05 18:10:56 +02:00
supersync-token-expiry.spec.ts test(e2e): fix failing supersync E2E tests 2026-02-12 18:02:14 +01:00
supersync-vector-clock-max-size.spec.ts fix(sync): remove dead code, add defensive checks, and clean up vector clock logic 2026-02-02 17:15:13 +01:00
supersync-vector-clock-pruning.spec.ts fix: resolve pre-existing lint and prettier errors blocking commits (#6840) 2026-03-15 16:47:52 +01:00
supersync-worklog.spec.ts feat(history): merge Quick History and Worklog into a unified History view (#8033) 2026-06-05 18:10:56 +02:00
supersync-wrong-password-error.spec.ts test(e2e): fix failing supersync E2E tests 2026-03-07 22:32:03 +01:00
supersync.spec.ts feat(history): merge Quick History and Worklog into a unified History view (#8033) 2026-06-05 18:10:56 +02:00
webdav-conflict-use-remote-restore-8107.spec.ts fix(sync): make 'Use Server Data' recoverable + guard the destructive choice (#8107) (#8151) 2026-06-08 16:34:59 +02:00
webdav-encryption-conflict-use-local.spec.ts feat(shepherd): remove all tours except keyboard navigation 2026-03-22 17:00:42 +01:00
webdav-encryption-disable.spec.ts fix(e2e): resolve flaky WebDAV tests and fix encryption test failures 2026-01-28 21:55:04 +01:00
webdav-first-sync-conflict.spec.ts fix(sync): break iOS WebDAV conflict-dialog loop (#7339) 2026-04-25 22:36:14 +02:00
webdav-legacy-migration-sync.spec.ts Improve on sync (#7736) 2026-05-22 17:49:25 +02:00
webdav-provider-switch.spec.ts test(sync): add E2E test for fresh-client sync duplication bug (b2b63da9) 2026-02-03 14:38:05 +01:00
webdav-single-client-rapid-sync.spec.ts fix(sync): preserve own vector clock counter across full-state op resets 2026-04-01 15:41:13 +02:00
webdav-sync-advanced.spec.ts test(e2e): open attachment dialog via detail panel after #7314 2026-04-25 22:36:14 +02:00
webdav-sync-archive.spec.ts feat(shepherd): remove all tours except keyboard navigation 2026-03-22 17:00:42 +01:00
webdav-sync-delete-cascade.spec.ts feat(shepherd): remove all tours except keyboard navigation 2026-03-22 17:00:42 +01:00
webdav-sync-error-handling.spec.ts test(e2e): harden failure signals and provider gates (#7753) 2026-05-23 20:33:04 +02:00
webdav-sync-expansion.spec.ts test(e2e): fix failing sync tests and reduce flakiness 2026-03-27 17:33:38 +01:00
webdav-sync-full.spec.ts feat(sync): replace WebDAV header-based conflict detection with content hashing 2026-03-30 17:33:06 +02:00
webdav-sync-tags.spec.ts fix(ci): exclude WebDAV and SuperSync tests from build workflow 2026-01-21 20:42:50 +01:00
webdav-sync-task-order.spec.ts fix(ci): exclude WebDAV and SuperSync tests from build workflow 2026-01-21 20:42:50 +01:00
webdav-sync-today-tag.spec.ts feat(shepherd): remove all tours except keyboard navigation 2026-03-22 17:00:42 +01:00