Skip to content

fix(ios): devsupport IPv6 host parsing for packager and inspector#55923

Closed
hannojg wants to merge 1 commit intofacebook:mainfrom
hannojg:hannojg/ios-ipv6-packager-inspector
Closed

fix(ios): devsupport IPv6 host parsing for packager and inspector#55923
hannojg wants to merge 1 commit intofacebook:mainfrom
hannojg:hannojg/ios-ipv6-packager-inspector

Conversation

@hannojg
Copy link
Copy Markdown
Contributor

@hannojg hannojg commented Mar 5, 2026

Summary:

When Metro host is an IPv6, iOS dev-support had two parsing issues, causing SIGABRTs:

  1. RCTPackagerConnection parsed host:port by splitting on :, which breaks IPv6 literals and can build an invalid websocket URL for /message.
  2. RCTInspectorDevServerHelper used NSURL.host directly to compose host[:port]. For IPv6, NSURL.host is unbracketed, producing an invalid authority for inspector endpoints.

Changes:

  • RCTPackagerConnection: parse host/port via NSURLComponents from a synthesized URL instead of splitting by :.
  • RCTInspectorDevServerHelper: re-add IPv6 brackets when composing authority strings from NSURL.host.

Changelog:

[IOS] [FIXED] - Fix iOS dev-support IPv6 handling for packager and inspector connections.

Test Plan:

  • Built RNTester Debug (Hermes + New Architecture) for iOS simulator.
  • Started Metro on IPv6:
    • RCT_METRO_PORT=8088 yarn --cwd packages/rn-tester start --host :: --port 8088
  • Launched RNTester with IPv6 Metro host in settings:
    • RCT_packager_scheme = http
    • RCT_jsLocation = [2a02:...]:8088
  • Verified in logs:
    • http://[2a02:...]:8088/status returns 200
    • bundle loads from http://[2a02:...]:8088/js/RNTesterApp.ios.bundle?...
  • Verified app remains running and renders RNTester UI (no SIGABRT in packager/inspector startup paths).

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 5, 2026
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 5, 2026
Copy link
Copy Markdown
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

Code looks good to me.

@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 6, 2026

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D95564862.

@hannojg
Copy link
Copy Markdown
Contributor Author

hannojg commented Apr 1, 2026

Hey, anything i can do to help land this? 🙈

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@hannojg
Copy link
Copy Markdown
Contributor Author

hannojg commented Apr 7, 2026

Weird, it does not 😅 (i guess somebody is testing that action right now)

@cortinico
Copy link
Copy Markdown
Contributor

Out of curiousity @hannojg, have you tested Android also against IPv6 bundlers?

Copy link
Copy Markdown
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@hannojg
Copy link
Copy Markdown
Contributor Author

hannojg commented Apr 8, 2026

No, I did not yet (my main use case are automated tests on AWS device farm which on iOS/macOS runners only support ipv6 for connections)

@meta-codesync meta-codesync bot closed this in 4a59f90 Apr 8, 2026
@facebook-github-tools facebook-github-tools bot added the Merged This PR has been merged. label Apr 8, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Apr 8, 2026

@cipolleschi merged this pull request in 4a59f90.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @hannojg in 4a59f90

When will my fix make it into a release? | How to file a pick request?

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants