fix(voice): prevent floating controls cleanup panic - #218
Conversation
morgmart
left a comment
There was a problem hiding this comment.
🤖 Automated code review
APPROVE. Fresh static review of exact three-dot range a1ae169...041b4d5 found no publishable issues. The change replaces teardown-sensitive webview URL reads with lifecycle-bound native revision state, validates registration against the active session and revision, conditionally clears only the captured revision, and preserves replacement-window race protection. Final self-check covered the floating-controls install, replacement, readiness timeout, terminal dismissal, stale cleanup during main-window close, and replacement-lifecycle race flows; accessibility, i18n, navigation/consent guards, async/error/never-completes/lifecycle/race behavior, test honesty, project laws and design-system rules, duplicate overlap, and blocking-evidence requirements. No unsupported or overlapping findings remain. Supplied GitHub evidence was inspected: all listed check runs at the exact head SHA completed successfully; the legacy combined-status endpoint is pending with no status contexts, so required checks still independently govern merge readiness.
Deterministic publication result: 0 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.
Pending checks: 1 check(s) are not complete.
This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.
Summary
Floating voice-controls cleanup could ask Wry for the
WKWebViewURL after WebKit had already cleared it. Wry 0.55.1 unwraps that missing URL and panics, closing Berd while a voice call is stopping or its controls are being replaced.Track the controls window's lifecycle revision in native voice state and use that state for matching and cleanup. The floating controls retain the same replacement and stale-window safety without reading a teardown-sensitive WebKit property.
Reviewer-reproducible examples
url_from_webviewpanic.