fix(core): release sync gate after Sync API failures#107
Merged
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
aman19K
reviewed
Apr 16, 2026
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
aman19K
approved these changes
Apr 16, 2026
harshitha-cstk
approved these changes
Apr 16, 2026
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.
fix(core): Sync resumes after Sync API timeout / failed get (DX-6146)
Summary
Fixes a condition where DataSync could stop processing new webhooks after a Sync API failure such as
Request timeout: the internal sync gate (flag.SQ) was only cleared in some error paths, so laterpoke()/check()calls did not startsync()again.Problem
Request timeout(or similar) during sync.flag.SQstayedtruewhenget()rejected in a way that did not match the previousnetConnectivityIssues(error)-only cleanup.Solution
fire(): On any rejection from the Sync APIget(), setflag.SQ = falseso the next notify can runsync()again (no longer conditional onnetConnectivityIssuesonly). Removed the redundantflag.SQclear tied solely to error 141 in that block (failure path now always releases the gate).sync(): IfgetToken()throws aftercheck()setSQbut beforefire(), clearflag.SQand rethrow.unlock():return check()so callers get the promise fromcheck().api.ts: Socket timeout rejects withcode: 'ETIMEDOUT'in addition to theRequest timeoutmessage.inet.ts: ExpandnetConnectivityIssues()(e.g.Request timeoutsubstring, additionalerror.codevalues) for nested handlers that still key off it.Tests
test/core/sync-resume.ts: Timeout on firstget, secondpoke()triggers anotherget.test/core/sync.ts,test/core/index.ts,test/api.ts,test/core/inet.tsas needed.jest.setup.js+setupFilesAfterEnvto stabilizemarkedin Jest.Version / deps
marked,@types/lodash, etc.).