Skip to content

fix(app): a browser tab on a port with nothing listening no longer crashes the app - #44

Merged
sean-brydon merged 1 commit into
mainfrom
fix/browser-nil-url
Oct 9, 2026
Merged

sean-brydon merged 1 commit into
mainfrom
fix/browser-nil-url

Conversation

@sean-brydon

Copy link
Copy Markdown
Collaborator

Fixes #36.

What broke

watch_console polled wv.url() every 500 ms. On macOS, wry's url() does webview.URL().unwrap() (tauri-apps/wry#1752), and WKWebView.URL is nil after a load that failed, such as http://localhost:3000 with no server. The panic aborted the app, and because the tab is restored on launch, every later launch crashed too.

The fix

We no longer call Webview::url. The drain question the watcher already sends to the page now returns location.href, a newline, then the console report. split_drain splits that answer and ignores anything that isn't http(s), such as the about:blank a pane is left on when its first load fails. Client-side route changes ("moved") still reach the address bar as before. They now share the drain's one-question-at-a-time gate, so a page stuck in a busy loop updates its address up to 5 s late.

Checks

  • cargo check, plus cargo test --lib browser (a new unit test for split_drain)
  • docs-site build (changelog bullet)
  • Not run: the app itself against a dead port, because launching a second dev app here would use this machine's live app data.

🤖 Generated with Claude Code

…ashes the app

The console watcher polled Webview::url twice a second. wry's url() unwraps
WKWebView.URL, which is nil after a failed load (connection refused), so the
panic aborted the app, and the restored tab crashed every launch after. The
watcher now reads location.href through the drain question it already sends.

Fixes #36

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
berth Ready Ready Preview Oct 9, 2026 9:28pm UTC
berth-docs Ready Ready Preview Oct 9, 2026 9:28pm UTC

Request Review

@sean-brydon
sean-brydon merged commit c8e2f99 into main Oct 9, 2026
8 checks passed
@linear-code

linear-code Bot commented Oct 9, 2026

Copy link
Copy Markdown

ENG-5868

This branch was successfully deployed

2 active deployments
Preview – berth-docs — d3e47377 Deployed Oct 9, 2026 by vercel[bot]
Preview – berth — d3e47377 Deployed Oct 9, 2026 by vercel[bot]
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.

App crashes when the Browser tab opens a localhost URL with no server (wry url() unwrap on nil)

1 participant