Skip to content

Conversation

@killagu
Copy link
Contributor

@killagu killagu commented Jan 22, 2026

isTraversableNavigable() was returning true unconditionally, which caused an infinite retry loop when the server responded with 401.

In Node.js environment, there is no traversable navigable that can prompt the user for credentials (unlike browsers). The 401 retry logic at step 14 of HTTP-network-or-cache fetch requires user interaction to provide credentials, which is not possible in Node.js.

Returning false disables the incomplete 401 retry logic that was causing the infinite loop, while preserving the URL credentials functionality added in #4747.

This relates to...

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

`isTraversableNavigable()` was returning `true` unconditionally, which
caused an infinite retry loop when the server responded with 401.

In Node.js environment, there is no traversable navigable that can
prompt the user for credentials (unlike browsers). The 401 retry logic
at step 14 of HTTP-network-or-cache fetch requires user interaction to
provide credentials, which is not possible in Node.js.

Returning `false` disables the incomplete 401 retry logic that was
causing the infinite loop, while preserving the URL credentials
functionality added in nodejs#4747.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 22, 2026 14:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an infinite retry loop that occurs when the server responds with a 401 status code in Node.js environments. The issue was caused by isTraversableNavigable() returning true unconditionally, triggering retry logic designed for browsers that can prompt users for credentials—a capability Node.js lacks.

Changes:

  • Modified isTraversableNavigable() to return false instead of true
  • Added explanatory comments describing why Node.js environments cannot support traversable navigables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@silversf
Copy link

Stumbled independently upon the same issue so can confirm described issue is real, didn't confirm the fix though.

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.15%. Comparing base (761fce9) to head (c33ff33).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4756      +/-   ##
==========================================
- Coverage   93.22%   93.15%   -0.08%     
==========================================
  Files         109      109              
  Lines       34024    34026       +2     
==========================================
- Hits        31720    31697      -23     
- Misses       2304     2329      +25     

☔ View full report in Codecov by Sentry.
📢 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.

Ensures that when a server responds with 401 Unauthorized, fetch does
not enter an infinite retry loop. This test verifies the fix for
isTraversableNavigable() returning false in Node.js environment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Member

@KhafraDev KhafraDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't fix the issue, it (essentially) reverts 3388513 and brings back the bug with basic authentication in websockets (node test/web-platform-tests/wpt-runner.mjs run /websockets/basic-auth.any)

@KhafraDev KhafraDev mentioned this pull request Jan 23, 2026
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.

4 participants