Skip to content

[v7.x] fix(cache): do not report aborted on successful cache hits (#5819) - #6037

Open
mrityunjay-pandey wants to merge 1 commit into
nodejs:v7.xfrom
mrityunjay-pandey:backport/v7.x-cache-hit-aborted
Open

mrityunjay-pandey wants to merge 1 commit into
nodejs:v7.xfrom
mrityunjay-pandey:backport/v7.x-cache-hit-aborted

Conversation

@mrityunjay-pandey

Copy link
Copy Markdown
Contributor

This relates to...

Backport of #5819 to v7.x.

Rationale

The fix from #5819 is on main but not on v7.x. With the test from #5819 applied to v7.x, test/interceptors/cache.js has 1 failing test(s); with the fix they pass.

Changes

  • Clean cherry-pick of 65fd635 (git cherry-pick -x), no conflicts.

Features

N/A

Bug Fixes

Breaking Changes and Deprecations

N/A

Status

Tested locally on Linux with Node 24: npm run lint and npm run test:unit (1324 tests, 1321 pass, 3 skipped, 0 fail).

The cache interceptor treated stream.destroyed as aborted, so
onResponseEnd saw aborted=true after a normal cache hit. Track abort
with an explicit flag set only in abort().

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
(cherry picked from commit 65fd635)
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.18%. Comparing base (7507102) to head (d87898b).

Additional details and impacted files
@@            Coverage Diff             @@
##             v7.x    #6037      +/-   ##
==========================================
+ Coverage   93.15%   93.18%   +0.02%     
==========================================
  Files         112      112              
  Lines       37626    37629       +3     
==========================================
+ Hits        35052    35066      +14     
+ Misses       2574     2563      -11     

☔ 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.

This branch has not been deployed

No deployments
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.

3 participants