Skip to content

fix(mobile): use port 443 for explicit WSS host edits - #31659

Merged
nwparker merged 1 commit into
mainfrom
nwparker/mobile-b4-wss-port
Oct 21, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/mobile-b4-wss-port

Conversation

@nwparker

@nwparker nwparker commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​36
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

ELI5

When you replace a saved local address with a secure tunnel URL, the phone now uses the normal secure port, 443. It previously kept the old local port, such as 6768.

What Changed

  • Explicit wss:// inputs without a port use 443 when editing a saved host.
  • Bare addresses still inherit the saved scheme/port. Explicit custom ports and saved proxy paths/queries remain intact.
  • The address hint explains the two behaviors. Regression tests cover the resolver and the actual edit-screen preview/save handler.

Why

The edit resolver supplied the saved port before considering an explicitly entered secure URL. This adjusts that fallback and reuses the existing normalizer and save flow.

Linked Issue

No separate issue identified for this address-editing symptom. Adapted from the mobile portion of community PR #31499; broader tunnel feature requests remain open.

Visual Proof

Real React Native Edit host screen on an iOS 26.1 simulator, captured without showing Simulator or taking desktop focus. Same synthetic saved LAN endpoint and same typed URL before/after. Visually checked both captures: the form remains legible and the preview changes from 6768 to 443.

Before After
Before: explicit WSS incorrectly retains LAN port 6768 After: explicit WSS uses secure port 443

Testing

  • Reproduced five failing regression cases before the fix; 74 focused tests pass after the fix. Independent reviewer also ran all 74.
  • Native input exercised the production screen/resolver. Tapping Save persisted wss://tunnel.example.com:443 through the real host-store/AsyncStorage path; readback and device storage manifest agree.
  • Fixture supplied synthetic host data, router/client-context hooks, and a synthetic token provider because the dev binary lacks a working keychain entitlement. No real tunnel connectivity or credential handling is claimed.
  • Mobile typecheck (tsc --noEmit -p mobile/tsconfig.json), changed-code quality gate, formatting, and diff whitespace checks pass. Typecheck used the repository-patched WebView declaration in a private dependency overlay; shared dependencies were not edited.

Review / Community attribution

Adapted the address-editing approach from #31499 by @chunchet-ng (Chun Chet Ng). Commit includes Co-authored-by: Chun Chet Ng <ngchunchet95@gmail.com> using the community commit's author identity. Independent Codex peer review found no issues.

Merge risk / Limitations

Low: four files, one port-selection fallback, copy, and focused regression coverage. No wire format, server behavior, platform-specific process/path handling, workspace assumptions, or new dependency. Mixed-version local/remote hosts keep the same connection contract. Android native execution and a live tunnel connection were not exercised; CI remains required.

Agent skill upstream boundary

  • No upstream skill-installer source or resources copied.

Checklist

  • Small, focused change; behavior and mechanism explained
  • Before/after screenshots attached and visually reviewed
  • Self-reviewed and independently reviewed
  • Mobile, remote, folder-workspace and cross-platform impact considered
  • Focused tests and changed-code quality checks pass

Compatibility review: saved host records are not migrated or rewritten. A name-only or no-op Save preserves the endpoint and route suffix; an explicit custom port wins, and a bare hostname inherits the saved scheme/port. The deliberate change applies when an edit explicitly enters wss://new-host without a port: it uses 443 instead of carrying forward the old 6768/8443 port. Users moving to another host on a custom TLS port must enter it, for example wss://new-host:8443. All 74 endpoint/edit/save checks pass again.

Adapt the mobile address-editing fix from community PR #31499. Keep bare-host inheritance, explicit ports, and stored routes intact.

Co-authored-by: Chun Chet Ng <ngchunchet95@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 15 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b1e27f17-bb9b-465f-b2b1-c0cdb5301694
📥 Commits

Reviewing files that changed from the base of the PR and between c054e94 and 4ec2de1.

📒 Files selected for processing: 4
  • mobile/app/h/[hostId]/edit.tsx
  • mobile/src/host-edit-save-flow.test.ts
  • mobile/src/transport/host-endpoint-edit.test.ts
  • mobile/src/transport/host-endpoint-edit.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit f6fc6d0 into main Oct 21, 2026
22 checks passed
@nwparker
nwparker deleted the nwparker/mobile-b4-wss-port branch October 21, 2026 23:32
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.

1 participant