Repository navigation
Feature/sync client - #18
Merged
Merged
Conversation
priyanshuvishwakarma273403
requested review from
Aidmann,
BixbyCodes,
DenizAltunkapan,
GideonBa and
MaximilianRau04
as code owners
August 23, 2026 12:15
MaximilianRau04
requested changes
Aug 23, 2026
MaximilianRau04
left a comment
Contributor
There was a problem hiding this comment.
Push result is never applied, so ack tracking is dead code. Works today by accident, not by design.
MaximilianRau04
approved these changes
Aug 24, 2026
MaximilianRau04
left a comment
Contributor
There was a problem hiding this comment.
Verified: push result now flows into applyAck with correct op_id/seq, and the client types match docsgraph-server's actual contract. Approving.
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.
Overview
This PR implements the client-side synchronization infrastructure for
docsgraph. It introduces a production-ready HTTP client communicating withdocsgraph-server's sync endpoints and an orchestrator (SyncManager) that manages local-to-remote pushing/pulling, handles offline gracefully, and automatically resumes on reconnection.Key Changes
1. HTTP Sync Client (
packages/data/src/sync/client.ts)HttpSyncClientimplementingSyncClientusing nativefetch.docsgraph-serversync endpoints:POST /api/v1/sync/pushGET /api/v1/sync/pull?since=<cursor>() => string | null.2. Sync Manager Orchestration (
packages/data/src/sync/manager.ts)SyncManagercoordinating data exchange betweenLocalStoreandSyncClient.offlineinstead of crashing.onlineevents to automatically retry sync cycles when connectivity is restored. Includes a configurable polling fallback.anytypings entirely to satisfy strict ESLint rules.3. Verification & Testing (
packages/data/src/sync/sync.test.ts)HttpSyncClientAPI request body, params, and header validation.SyncManagerlifecycle (Happy path pushing/pulling, offline graceful degradation on fetch failure, and automatic retry ononlineevents).window,navigator, andfetchproperties using property descriptor overrides to ensure compatibility with strict environments (Node.js/JSDOM).Verification Results
All tests and code checks run successfully locally:
pnpm lint: Passed (0 warnings/errors)pnpm test: Passed (12/12 tests)