Repository navigation
Fix browser issues #1029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix browser issues #1029
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2281,6 +2281,28 @@ final class WindowBrowserPortal: NSObject { | |||||||||||||
| return | ||||||||||||||
| } | ||||||||||||||
| guard anchorView.window === window else { | ||||||||||||||
| let isOffWindowReparent = | ||||||||||||||
| entry.visibleInUI && | ||||||||||||||
| anchorView.window == nil && | ||||||||||||||
| anchorView.superview != nil | ||||||||||||||
| if isOffWindowReparent { | ||||||||||||||
| let didScheduleTransientRecovery = scheduleTransientRecoveryRetryIfNeeded( | ||||||||||||||
| forWebViewId: webViewId, | ||||||||||||||
| entry: &entry, | ||||||||||||||
| webView: webView, | ||||||||||||||
| reason: "anchorWindowMismatch" | ||||||||||||||
| ) | ||||||||||||||
| #if DEBUG | ||||||||||||||
| if didScheduleTransientRecovery && !containerView.isHidden { | ||||||||||||||
| dlog( | ||||||||||||||
| "browser.portal.hidden.deferKeep web=\(browserPortalDebugToken(webView)) " + | ||||||||||||||
| "reason=anchorWindowMismatch.offWindow frame=\(browserPortalDebugFrame(containerView.frame))" | ||||||||||||||
| ) | ||||||||||||||
| } | ||||||||||||||
| #endif | ||||||||||||||
| containerView.setDropZoneOverlay(zone: nil) | ||||||||||||||
| return | ||||||||||||||
|
Comment on lines
+2288
to
+2304
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zombie portal when retry budget is exhausted When Compare this to the existing code immediately below: when the non-off-window anchor-window-mismatch path exhausts its budget, In the off-window path the only escape from this state is an external call to Consider hiding the container (and clearing the remaining overlays) when the budget is exhausted, analogous to the fallthrough behaviour in the non-off-window path: if isOffWindowReparent {
let didScheduleTransientRecovery = scheduleTransientRecoveryRetryIfNeeded(
forWebViewId: webViewId,
entry: &entry,
webView: webView,
reason: "anchorWindowMismatch"
)
if didScheduleTransientRecovery {
#if DEBUG
if !containerView.isHidden {
dlog(
"browser.portal.hidden.deferKeep web=\(browserPortalDebugToken(webView)) " +
"reason=anchorWindowMismatch.offWindow frame=\(browserPortalDebugFrame(containerView.frame))"
)
}
#endif
containerView.setDropZoneOverlay(zone: nil)
return
}
// Budget exhausted — fall through to hide/cleanup below
}
Comment on lines
+2303
to
+2304
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When the transient recovery budget is exhausted ( Prompt for AI agents
Suggested change
|
||||||||||||||
| } | ||||||||||||||
| if scheduleTransientDetachRecovery(reason: "anchorWindowMismatch") { | ||||||||||||||
| containerView.setPaneTopChromeHeight(0) | ||||||||||||||
| containerView.setSearchOverlay(nil) | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading debug log name
The log key
browser.portal.hidden.deferKeepis emitted inside the guard!containerView.isHidden, meaning the container is currently visible and is being kept visible — it is not being hidden. The namehiddenin the key will confuse log-analysis tooling or anyone grepping for hide events.A name like
browser.portal.visible.deferKeeporbrowser.portal.sync.deferKeepwould better reflect what is actually happening at this point.