Skip to content

Keep serving when network interface discovery is unavailable - #863

Closed
charan-rathore wants to merge 1 commit into
vercel:mainfrom
charan-rathore:fix-optional-network-discovery
Closed

charan-rathore wants to merge 1 commit into
vercel:mainfrom
charan-rathore:fix-optional-network-discovery

Conversation

@charan-rathore

Copy link
Copy Markdown

Related Issues

Fixes #746.

Description

Added

Regression coverage for a throwing os.networkInterfaces() and a normal external IPv4 address, plus a patch changeset and a README note.

Changed

Defer interface discovery until getNetworkAddress is called and return no network address when discovery fails. Importing the utility no longer queries the interfaces. Network discovery only supplies an optional banner URL, so its failure should not stop a local HTTP server.

Removed

The import-time interface snapshot.

Caveats/Problems/Issues

Checked on Node 22.23.3 with pnpm 10.33.0 and the repository's Vitest 2.1.3:

  • Baseline regression: 1 pass, 1 fail, with the failure at the import-time interface query.
  • pnpm test: TypeScript check and all 30 unit tests pass with coverage enabled.
  • pnpm lint and pnpm compile: pass.
  • Compiled CLI started under a preload that makes the actual Node builtin throw. It served fixture HTTP 200 with correct content and no network URL. No Android/Termux hardware test performed.
  • Standalone run_tests.sh passed from a second fresh clone/install, including the baseline failure, full tests/lint/compile and compiled CLI HTTP proof.

Open #859 changes when network URLs are advertised for specific listeners. This fix only makes discovery optional and should compose; it does not change binding behavior or that PR's listener rules.

Checklist

  • Related issue mentioned above.
  • Added/changed/removed behavior described above.
  • All tests (pnpm test) pass.
  • pnpm lint passes.
  • Added optional-discovery comment; existing helper TSDoc and return annotation retained.

@vercel

vercel Bot commented Oct 1, 2026

Copy link
Copy Markdown

@charan-rathore is attempting to deploy a commit to the Internal Playground Team on Vercel.

A member of the Team first needs to authorize it.

@charan-rathore

Copy link
Copy Markdown
Author

No movement on this, so closing it off. Happy to revisit if there is interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant