super-productivity/packages/super-sync-server/tests
Johannes Millan 7eabbc34b9 fix(sync): make super-sync-server migrations buildable from scratch
The Prisma migration chain began with an ALTER on the operations table, so
a fresh database could not be initialized from migrations alone (the first
migration failed with no table to ALTER). Separately, the login_token /
login_token_expires_at columns and index existed in schema.prisma and were
used at runtime by src/auth.ts (magic-link login) but were never created by
any migration, so a migrate-only database crashed with
"column users.login_token does not exist".

- Add a 0_init baseline migration that creates the base tables (the
  pre-2025-12-12 shape), sorting before the first incremental migration so
  the existing ALTER migrations apply cleanly on top.
- Add 20260601000000_add_login_token to create the missing magic-link
  columns and index (IF NOT EXISTS, safe on installs that already have them
  from a prior db push).
- Add migration_lock.toml (provider = postgresql), the standard companion to
  a real migration baseline.
- Document baselining for existing databases: `migrate resolve --applied
  0_init` for installs with migration history, and resolving the whole chain
  for db-push installs with none (covers the Helm/Docker unattended paths).
- Add regression tests asserting the baseline exists and that every @map
  column in schema.prisma stays backed by a migration (guards the drift class
  that caused this bug, not just login_token).

Verified by replaying all migrations on a fresh Postgres: the chain applies
cleanly and the resulting schema matches schema.prisma exactly.

Closes #8187
2026-06-09 11:36:44 +02:00
..
integration test(supersync): cover WS storm fixes with unit + integration tests 2026-05-20 15:57:00 +02:00
account-page-contrast.spec.ts fix(supersync): improve account badge contrast (#8186) 2026-06-09 00:13:33 +02:00
api.routes.spec.ts Pr 6741 (#6743) 2026-03-05 21:17:59 +01:00
auth-cache.spec.ts perf(sync): SuperSync server speed + correctness hardening (#7621) 2026-05-15 17:24:16 +02:00
auth-flows.spec.ts Pr 6741 (#6743) 2026-03-05 21:17:59 +01:00
cleanup.spec.ts fix(supersync): order cleanup reconcile stalest-first and add C1 regression tests 2026-05-12 22:25:18 +02:00
config.spec.ts feat(supersync): configure server bind host #7301 (#8108) 2026-06-08 12:12:49 +02:00
conflict-detection.spec.ts fix(supersync): aggregate prior clocks for full-state ops and deterministic retry lookup 2026-05-13 17:01:39 +02:00
conflict.spec.ts fix(sync): accept encrypted retries as duplicate, not invalid op id 2026-05-23 16:46:05 +02:00
decompress-body.spec.ts Merge branch 'master' into feat/our-latest-super-sync-server-update 2026-05-12 20:40:26 +02:00
device.service.spec.ts refactor(sync): extract DeviceService and OperationDownloadService 2025-12-27 20:43:25 +01:00
duplicate-operation-precheck.spec.ts fix supersync retry idempotency 2026-05-13 00:14:35 +02:00
email.spec.ts Fix super-sync server auth and snapshot safety 2025-12-12 20:48:13 +01:00
gap-detection.spec.ts perf(sync): use indexed findFirst for op-download minSeq 2026-05-18 14:21:02 +02:00
magic-link-registration.spec.ts fix(sync): preserve own vector clock counter across full-state op resets 2026-04-01 15:41:13 +02:00
middleware.spec.ts Pr 6741 (#6743) 2026-03-05 21:17:59 +01:00
migrate-deploy-script.spec.ts fix(supersync): address multi-agent review of CONCURRENTLY recovery 2026-05-15 22:03:25 +02:00
migration-sql.spec.ts fix(sync): make super-sync-server migrations buildable from scratch 2026-06-09 11:36:44 +02:00
op-replay.spec.ts refactor(sync): decompose SuperSync server giants into cohesive modules 2026-05-15 20:06:12 +02:00
operation-download.service.spec.ts perf(sync): use indexed findFirst for op-download minSeq 2026-05-18 14:21:02 +02:00
passkey.spec.ts test(sync): fix failing unit tests for recent server changes 2026-01-24 21:14:58 +01:00
password-reset-api.spec.ts Revert "feat(sync): add rolling JWT token refresh on sync requests" 2026-02-02 17:15:13 +01:00
password-reset.spec.ts fix(security): address critical and high severity vulnerabilities 2025-12-31 12:15:56 +01:00
rate-limit.service.spec.ts refactor(sync): extract services from SyncService and migrate tests to Prisma 2025-12-27 20:38:26 +01:00
registration-api.spec.ts chore(sync-server): update npm scripts and expand legal docs 2025-12-15 13:47:42 +01:00
replace-token-expiry.spec.ts fix(sync): fix supersync server unit test failures 2026-03-22 10:10:19 +01:00
request-deduplication.service.spec.ts feat(supersync): persist full-state vector clock and add snapshot retry idempotency 2026-05-13 17:01:39 +02:00
retention-config.spec.ts fix(security): address critical and high severity vulnerabilities 2025-12-31 12:15:56 +01:00
security-fixes.spec.ts test: strengthen unit test assertions and revive disabled plugin specs (#7755) 2026-05-23 18:31:53 +02:00
server-security.spec.ts test: strengthen unit test assertions and revive disabled plugin specs (#7755) 2026-05-23 18:31:53 +02:00
server.error-log-level.spec.ts feat(supersync): configure server bind host #7301 (#8108) 2026-06-08 12:12:49 +02:00
setup.ts fix(supersync): sanitize errors, exact full-state quota, atomic counter 2026-05-12 21:36:49 +02:00
snapshot-skip-optimization.spec.ts test(sync-server): add comprehensive edge case tests for snapshot skip 2025-12-17 11:42:32 +01:00
snapshot.service.spec.ts test: strengthen unit test assertions and revive disabled plugin specs (#7755) 2026-05-23 18:31:53 +02:00
storage-quota-cleanup.spec.ts refactor(sync): decompose SuperSync server giants into cohesive modules 2026-05-15 20:06:12 +02:00
storage-quota.service.spec.ts perf(sync): SuperSync server speed + correctness hardening (#7621) 2026-05-15 17:24:16 +02:00
sync-compressed-body.routes.spec.ts perf(sync): SuperSync server speed + correctness hardening (#7621) 2026-05-15 17:24:16 +02:00
sync-fixes.spec.ts test: strengthen unit test assertions and revive disabled plugin specs (#7755) 2026-05-23 18:31:53 +02:00
sync-operations.spec.ts test: strengthen unit test assertions and revive disabled plugin specs (#7755) 2026-05-23 18:31:53 +02:00
sync-types.spec.ts test(sync): add vector clock pruning edge case tests (#6506) 2026-02-13 12:42:36 +01:00
sync.routes.spec.ts refactor(sync): unify JWT expiry to 365 days for all auth methods 2026-02-16 18:44:27 +01:00
sync.service.spec.ts refactor(sync): decompose SuperSync server giants into cohesive modules 2026-05-15 20:06:12 +02:00
sync.service.test-state.ts perf(super-sync): optimize status and conflict checks 2026-05-13 11:40:43 +02:00
time-tracking-operations.spec.ts refactor(sync): decompose SuperSync server giants into cohesive modules 2026-05-15 20:06:12 +02:00
validation.service.spec.ts refactor(sync): decompose SuperSync server giants into cohesive modules 2026-05-15 20:06:12 +02:00
websocket-connection.service.spec.ts refactor(supersync): address round-2 review of WS reconnect cooldown fix 2026-05-20 15:57:00 +02:00
websocket.routes.spec.ts test(supersync): cover WS storm fixes with unit + integration tests 2026-05-20 15:57:00 +02:00