Repository navigation
test(synq): done roadmap todos become real tests, only isSyncing stays todo - #577
Merged
Merged
Conversation
…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.
Owner
Author
|
Local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
playground/packages/synq/src/core/sync-engine.todo.test.tslisted 8 roadmapit.todos for layers that mostly exist now: thecreateSynqStoragedb factory, the live-query engine behinduseCollection, and the IndexedDB adapter. The test list said they were unbuilt.What changes, per todo:
db[name]insert/update/delete/get/querycreate-synq.test.ts, todo removeddb.sync()reconciles every collection;db[name].sync()onecreate-synq.test.tslive-queries.test.ts(gcTime:0 SWR + dedup tests), todo removedlive-queries.test.ts(finite gcTime, fake timers)isSyncingduring a sync runindexeddb.adapter.test.ts, todo removedindexeddb.adapter.test.ts, todo removedTest-only: no change to synq source or API.
Reproduce:
cd playground/packages/synq && pnpm testonmainshows8 todo.Verify:
pnpm testinplayground/packages/synq: 124 passed, 1 todoexpected length 2 but got 3); makingdb.sync()run only the first collection fails the scope test (expected length 2 but got 1)pnpm biome:check:playground,tsc --buildinplayground/: cleanpnpm gate: see comment belowTested on: Linux, Node 22.
Not tested: browsers (the change only touches node-environment unit tests).