Skip to content

fix(deduplicate): make terminal callbacks exception-safe - #5838

Open
mcollina wants to merge 2 commits into
mainfrom
fix/deduplicate-terminal-lifecycle
Open

mcollina wants to merge 2 commits into
mainfrom
fix/deduplicate-terminal-lifecycle

Conversation

@mcollina

Copy link
Copy Markdown
Member

Make deduplication terminal callbacks exception-safe. Remove completed requests from the pending map before notifying downstream handlers, forward completion errors to the corresponding handler, and ensure one throwing callback does not prevent other callers from completing.

Preserve retry eligibility when a waiting handler rejects completion, and handle deferred completion after a paused caller resumes. Add regression coverage for callback failures, reentrant dispatch, and paused callers.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
Signed-off-by: Matteo Collina <hello@matteocollina.com>
@codecov-commenter

codecov-commenter commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.09091% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.57%. Comparing base (bfea020) to head (ad30f0a).

Files with missing lines Patch % Lines
lib/handler/deduplication-handler.js 89.09% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5838      +/-   ##
==========================================
+ Coverage   93.53%   93.57%   +0.04%     
==========================================
  Files         110      110              
  Lines       39773    39790      +17     
==========================================
+ Hits        37200    37234      +34     
+ Misses       2573     2556      -17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants