Skip to content

fix(app): read IPv6 hosts in the insecure-station check, and log unexpected teardown failures - #6

Merged
perminder-klair merged 1 commit into
mainfrom
fix/small-review-bugs
Nov 15, 2026
Merged

perminder-klair merged 1 commit into
mainfrom
fix/small-review-bugs

Conversation

@perminder-klair

Copy link
Copy Markdown
Contributor

Summary

Two fixes from the comment review (#5).

Insecure-station warning and IPv6. hostOf split on :, so a bracketed IPv6 address came out as [ or [2001. Neither contains a ., and isLocalHost treats a host without a dot as local, so a public IPv6 station on plain http never got the insecure warning. The check moves out of onboarding.tsx into a tested module:

 src/
 ├── app/onboarding.tsx      # setInsecure(isInsecureBase(base))
+└── lib/insecure-base.ts    # hostOf, isLocalHost, isInsecureBase
hostOf(base)
  strip scheme, cut at / ? #
  [v6]:port  -> v6
  host:port  -> host
isLocalHost(h)
  IPv6 -> ::1, fc00::/7, fe80::/10
  IPv4 / names -> unchanged rules

teardown catch. TrackPlayer.reset() errors were all swallowed. Now only RNTP's player_not_initialized is ignored, and any other failure goes to the playback log, so it shows up in Share playback log. It still doesn't throw, so a station switch or sign-out never half-completes.

Evidence

  • Before: hostOf('http://[::1]:3000') → "[", hostOf('http://[2001:db8::5]:8000') → "[2001", so http://[2001:db8::5] counted as local and got no warning
    After: scripts/insecure-base.test.ts passes: ::1 and 2001:db8::5 are read correctly, public IPv6 over http is insecure, and ::1, fd12:… and fe80::1 are local. npm test 498/498, tsc clean, lint 0 errors

Merge Danger

Door: two-way

Blast Radius: onboarding

Only the http warning after a station check can change, and only for IPv6 hosts. Teardown behaves as before apart from the log line.

@perminder-klair
perminder-klair merged commit 0a47f33 into main Nov 15, 2026
2 checks passed
@perminder-klair
perminder-klair deleted the fix/small-review-bugs branch November 15, 2026 11:17
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