Skip to content

test(synq): done roadmap todos become real tests, only isSyncing stays todo - #577

Merged
arrzdev merged 1 commit into
mainfrom
test/synq-roadmap-todos
Nov 17, 2026
Merged

arrzdev merged 1 commit into
mainfrom
test/synq-roadmap-todos

Conversation

@arrzdev

@arrzdev arrzdev commented Nov 17, 2026

Copy link
Copy Markdown
Owner

playground/packages/synq/src/core/sync-engine.todo.test.ts listed 8 roadmap it.todos for layers that mostly exist now: the createSynqStorage db factory, the live-query engine behind useCollection, and the IndexedDB adapter. The test list said they were unbuilt.

What changes, per todo:

Todo Outcome
db exposes db[name] insert/update/delete/get/query already tested in create-synq.test.ts, todo removed
db.sync() reconciles every collection; db[name].sync() one new test in create-synq.test.ts
insert appends an op and the read view shows it optimistically existing insert test now also asserts the outbox op
warm cache served instantly, then live-updates already tested in live-queries.test.ts (gcTime:0 SWR + dedup tests), todo removed
query cache ref-counted and GC'd after the last unmount new test in live-queries.test.ts (finite gcTime, fake timers)
isSyncing during a sync run not built, stays todo
IndexedDB persists rows/ops/cursor across reopen already tested in indexeddb.adapter.test.ts, todo removed
IndexedDB notifies once per atomic transaction already tested in indexeddb.adapter.test.ts, todo removed

Test-only: no change to synq source or API.

Reproduce: cd playground/packages/synq && pnpm test on main shows 8 todo.

Verify:

  • pnpm test in playground/packages/synq: 124 passed, 1 todo
  • mutation check: dropping the gcTime teardown timer fails the ref-count test (expected length 2 but got 3); making db.sync() run only the first collection fails the scope test (expected length 2 but got 1)
  • pnpm biome:check:playground, tsc --build in playground/: clean
  • pnpm gate: see comment below

Tested on: Linux, Node 22.
Not tested: browsers (the change only touches node-environment unit tests).

…s todo

The roadmap todo file listed the db factory, the live-query engine behind
useCollection and the IndexedDB adapter as unbuilt, but all three exist.
Covered behaviour loses its todo; the two gaps get tests: db.sync() versus
db[name].sync() scope, and finite-gcTime ref-counted teardown. isSyncing
does not exist yet and stays a todo.
@arrzdev

arrzdev commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Local pnpm gate: green (exit 0, ends with ✔ styles.css is plain CSS; tailwind.css compiles).

@arrzdev
arrzdev marked this pull request as ready for review November 17, 2026 12:36
@arrzdev
arrzdev merged commit dd45bc4 into main Nov 17, 2026
6 checks passed
@arrzdev
arrzdev deleted the test/synq-roadmap-todos branch November 17, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant