Repository navigation
fix(worker): reset the failure clock after a failure in the same batch - #43
Merged
kamilmysliwiec merged 1 commit intoOct 22, 2026
Conversation
This was referenced Oct 22, 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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Hi! 👋 When one worker batch has a failed delivery and then a successful delivery to the same endpoint, the success does not reset the failure clock. The worker reads the endpoint once for each group, and the failure does not update that copy. So the success sees
failingSince: nulland skipsrecordEndpointSuccess(). The docs say "A success at any point resets the clock".Issue Number: #42
What is the new behavior?
failingSinceon its copy of the endpoint. A later success in the same group then callsrecordEndpointSuccess(), and the store resets the clock.recordEndpointFailure()itself fails, the copy does not change, because the store did not setfailingSinceeither.I ran the repro of the issue against a packed build of this branch:
Does this PR introduce a breaking change?
A success in a separate batch, and a success after no failure, work as before.
Other information
The new test in
tests/outgoing.e2e.spec.tssends a delivery that fails and then a delivery that succeeds to one endpoint in one batch. It runs twice: once withretry: false, so the failure ends the delivery (failed), and once with the default retry, so the failure schedules a retry (retried). It checks thatfailingSinceisnullafter the batch, and that one failure 2 hours later does not disable the endpoint (withdisableEndpointAfter: '1h'). Without the fix, it fails withexpected 1792587247650 to be null. If I remove the fix from only one of the two return paths, the case for that path fails.The test above it, "disables an endpoint after disableEndpointAfter without a success, and a success resets the clock", sends each delivery in its own batch, so it did not catch this.
npx vitest run: 42 files passed, 581 tests passed, 386 skipped.npm run lintandnpm run buildpass.