feat(sync): add sync queue status observability - #68
Draft
eumaninho54 wants to merge 4 commits into
Draft
Conversation
Database.getSyncQueueStatus(schema) / useSyncStatus(schema) hook read sync_queue's pending count and oldest pending timestamp per entity, without needing the sync orchestrator (still a stub) to be finished. Backed by a new indexed SyncQueueReader::getStatus, with sync_queue's setup tables made eager (DatabaseManager::open()) so status reads work even before the first registerSchema() call. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
getSyncQueueStatus/getStatus tests inserted rows without updatedAt, which now fails registerSchema's NOT NULL datetime requirement for sync-enabled schemas (brought in by the develop merge). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Follows this codebase's convention (e.g. useInfiniteQuery/types/IState.ts) of keeping all typings under a hook's types/ folder, not inline. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
eumaninho54
marked this pull request as draft
July 14, 2026 00:57
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.
Summary
Database.getSyncQueueStatus(schema)/useSyncStatus(schema)to readsync_queue's pending count and oldest pendingupdated_atper entity, without needing the (still-stub-at-the-time) Sync Orchestrator to be finished.SyncQueueReader::getStatus, with sync infra tables/index made eager inDatabaseManager::open()so status reads work even before the firstregisterSchema()call.develop's Sync Orchestrator/HTTP client work (readPage, cursor/definition stores,SyncHttpCaller, retry+401 refresh) — resolved conflicts by keeping bothgetStatus(this branch) andreadPage(develop) side by side inSyncQueueReader, and folding develop's_salve_sync_cursors/_salve_sync_definitionstables into this branch'sensureSyncInfra()helper.getStatus-related tests to satisfy develop's new constraint that sync-enabled schemas require aNOT NULL datetime updatedAtcolumn.Test plan
npm run test:native— 137/137 test cases, 342 assertions passingnpm run typecheck— cleannpx jest(QueryDb/Database suites) — 60/60 passingCo-Authored-By: Claude Sonnet 5 noreply@anthropic.com