Skip to content

feat(sync): add sync queue status observability - #68

Draft
eumaninho54 wants to merge 4 commits into
mainfrom
feat/sync-queue-status
Draft

feat(sync): add sync queue status observability#68
eumaninho54 wants to merge 4 commits into
mainfrom
feat/sync-queue-status

Conversation

@eumaninho54

Copy link
Copy Markdown
Member

Summary

  • Adds Database.getSyncQueueStatus(schema) / useSyncStatus(schema) to read sync_queue's pending count and oldest pending updated_at per entity, without needing the (still-stub-at-the-time) Sync Orchestrator to be finished.
  • Backed by a new indexed SyncQueueReader::getStatus, with sync infra tables/index made eager in DatabaseManager::open() so status reads work even before the first registerSchema() call.
  • Merges in develop's Sync Orchestrator/HTTP client work (readPage, cursor/definition stores, SyncHttpCaller, retry+401 refresh) — resolved conflicts by keeping both getStatus (this branch) and readPage (develop) side by side in SyncQueueReader, and folding develop's _salve_sync_cursors/_salve_sync_definitions tables into this branch's ensureSyncInfra() helper.
  • Updates getStatus-related tests to satisfy develop's new constraint that sync-enabled schemas require a NOT NULL datetime updatedAt column.

Test plan

  • npm run test:native — 137/137 test cases, 342 assertions passing
  • npm run typecheck — clean
  • npx jest (QueryDb/Database suites) — 60/60 passing

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

eumaninho54 and others added 3 commits July 13, 2026 18:21
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>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a7777ac-b2e3-4051-8866-5a992d13ad0c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sync-queue-status

Comment @coderabbitai help to get the list of available commands.

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
eumaninho54 marked this pull request as draft July 14, 2026 00:57
Base automatically changed from develop to main July 26, 2026 23:38
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