Skip to content

Make sync an injectable SyncService - #149

Open
myieye wants to merge 3 commits into
sync-apply-directions-independentlyfrom
crdt-sync-service
Open

myieye wants to merge 3 commits into
sync-apply-directions-independentlyfrom
crdt-sync-service

Conversation

@myieye

@myieye myieye commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

[Claude, autonomous]

Turn the static SyncHelper into an injectable SyncService, so the logging follow-up can give it a logger and config. No behavior change.

  • Breaking: JsonSyncable is now internal. Create one with IJsonSyncableFactory.Create(dir) (registered by AddCrdtData), which returns an ISyncable; its constructor and FilenamePrefix/FilenameExtension constants are no longer public. Nothing in Lexbox uses them.
  • SyncWithResourceUpload moved over as is; it still has no callers.

🤖 Generated with Claude Code

myieye and others added 2 commits October 20, 2026 15:42
JsonSyncable is now created through a factory registered in
AddCrdtDataCore, so its constructor can take internal services. This
removes the public JsonSyncable type from the package; callers use
IJsonSyncableFactory.Create(dir), which returns an ISyncable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The static SyncHelper becomes SyncService, a singleton registered in
AddCrdtDataCore and injected into DataModel and JsonSyncable (via its
factory), so it can take a logger and config later. It takes the
serializer options in its constructor instead of per call. No
behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@myieye
myieye added this pull request to stack #150 October 20, 2026 15:34
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86dc48a6-6b0d-4b7d-9464-1d15743c7237
📥 Commits

Reviewing files that changed from the base of the PR and between fa4034f and 56c969b.

📒 Files selected for processing: 7
  • src/SIL.Harmony.Tests/JsonSyncableTests.cs
  • src/SIL.Harmony.Tests/Syncable/JsonSyncableSyncBackend.cs
  • src/SIL.Harmony/CrdtKernel.cs
  • src/SIL.Harmony/DataModel.cs
  • src/SIL.Harmony/JsonSyncable.cs
  • src/SIL.Harmony/JsonSyncableFactory.cs
  • src/SIL.Harmony/SyncService.cs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d5e33fd4-eef9-44ac-8249-b1a47cf7a4bd
📥 Commits

Reviewing files that changed from the base of the PR and between ca7662d and fa4034f.

📒 Files selected for processing: 7
  • src/SIL.Harmony.Tests/JsonSyncableTests.cs
  • src/SIL.Harmony.Tests/Syncable/JsonSyncableSyncBackend.cs
  • src/SIL.Harmony/CrdtKernel.cs
  • src/SIL.Harmony/DataModel.cs
  • src/SIL.Harmony/JsonSyncable.cs
  • src/SIL.Harmony/JsonSyncableFactory.cs
  • src/SIL.Harmony/SyncService.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Synchronization now uses an injected SyncService with configured serializer options. DataModel and the now-internal JsonSyncable delegate synchronization to that service. A new IJsonSyncableFactory creates JSON-backed syncables, and dependency registration and tests now use the factory.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: hahn-kev, rmunn

Merge Risk: ⚪ Minimal · up to fa403

The injectable sync service and factory are ready to merge after normal checks; no actionable regression was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: replacing static synchronization with an injectable SyncService.
Description check Passed The description directly explains the SyncService injection, JsonSyncable API change, factory usage, registration, and intended lack of behavior change.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@myieye myieye changed the title [claude] Make sync an injectable SyncService Make sync an injectable SyncService Oct 21, 2026
@myieye
myieye marked this pull request as ready for review October 21, 2026 07:34
@myieye
myieye requested a review from hahn-kev October 21, 2026 07:34
…vice

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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