Repository navigation
Don't panic syncing a browser pane whose navigation failed - #63
Merged
ryanclouser merged 1 commit intoOct 3, 2026
Merged
Conversation
On macOS, WKWebView.URL becomes nil once a provisional navigation fails (unresolvable host, offline, typo). lb-wry's url_from_webview unwraps that nil, and because BrowserView::sync runs inside a GPUI task on the main dispatch queue the panic aborts the whole app. The pane is restored on every launch, so muxel crash-loops until workspace.json is edited by hand. Check that the webview has a committed URL before asking wry for it, and treat its absence like any other "nothing to sync yet" tick. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #62
Problem
On macOS, a browser pane whose navigation fails (an unresolvable host, being offline, a typo in the URL) aborts muxel a few seconds after launch. The pane is restored on every launch, so muxel crash-loops until someone edits
workspace.jsonby hand.WKWebView.URLbecomesnilonce a provisional navigation fails. lb-wry'surl_from_webviewcalls.unwrap()on that value.BrowserView::syncruns inside a GPUI task on the main dispatch queue, so the panic can't unwind and the process getsSIGABRT. The existing.url().ok()?never runs, because the panic happens before anyResultis produced. Upstreamtauri-apps/wrystill has the sameunwrap.Fix
syncnow goes through a smallcommitted_urlhelper:WKWebView.URL(and itsabsoluteString) before callingwry::WebView::url(). When there is no URL,syncreturnsNone, the same way it already handles other "nothing to sync yet" states. The next tick tries again.url()already returns aResult.There are no behaviour changes for pages that load. One file changed.
Verification
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspaceall pass.HOME. The workspace has a single browser pane,browser_enabled = true, and the build was instrumented with temporaryeprintln!s that are not part of this PR:browser_urlsyncsawURL == nilmasterhttps://no-such-host-xyz123.invalid/url_from_webviewpanic (5/5 runs)masterhttps://deploy-preview-17--…netlify.app-/(the original report)https://no-such-host-xyz123.invalid/https://deploy-preview-17--…netlify.app-/https://example.com/Some("https://example.com/")on every tick)The table only counts runs where the webview was actually created. A few launches from a script never painted the pane, and I left those out because they prove nothing either way.
I built locally without full Xcode, so these binaries used gpui's
runtime_shadersfeature. That change is local only and not included here.I also confirmed the
nilwith a standalone SwiftWKWebViewprobe, with no muxel or wry involved. The URL is set right afterload, and isnilabout 6 s later for an unresolvable host. Forexample.comit stays set.🤖 Generated with Claude Code