Skip to content

feat(sync-engine): introduce pluggable SyncHandler interface in SyncManager (#37)#44

Open
rohansaini-02 wants to merge 1 commit into
theapprenticeproject:mainfrom
rohansaini-02:feature/sync-engine-handler-standalone
Open

feat(sync-engine): introduce pluggable SyncHandler interface in SyncManager (#37)#44
rohansaini-02 wants to merge 1 commit into
theapprenticeproject:mainfrom
rohansaini-02:feature/sync-engine-handler-standalone

Conversation

@rohansaini-02

Copy link
Copy Markdown

Summary

This PR introduces a pluggable SyncHandler interface in SyncManager within the poc-sync-engine package. This decouples queue orchestration from the mock API transport, allowing interchangeable mock or HTTP-backed execution handlers.

Related Issue

Resolves #37

Changes Made

  • Handler Abstraction: Defined and exported the SyncHandler interface with a handle(job: SyncJob) signature.
  • SyncManager Update: Constructor-injected the SyncHandler dependency and updated drainQueue() to delegate sync processing to it.
  • Cleanup: Removed the hardcoded mockFrappeApiCall private helper method.
  • Mock Testing: Refactored the test suite to use Jest mocks for asserting handler execution and success states.
  • Backoff Validation: Added a new unit test using Jest fake timers (jest.useFakeTimers()) to verify that connection rejections trigger exponential retry backoffs correctly.

Testing Performed

  • Ran the unit tests inside poc-sync-engine:
    npm test
    All 5 tests compiled and passed successfully.

@ravencore06

Copy link
Copy Markdown

Hey, did you get any update?

@rohansaini-02

Copy link
Copy Markdown
Author

Hey, did you get any update?

Not yet, most orgs have already notified their selected contributors, but there’s no update on the TAP projects yet

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.

feat(sync-engine): introduce pluggable SyncHandler interface in SyncManager

2 participants