Repository navigation
fix(extension): prune descendant frameOwnerPage entries on frame detach and page close - #3403
FelixFangX wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 5549fd2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
…ch and page close Page.frameDetached deleted only the detached frame id, so nested frames kept BrowserContext.frameOwnerPage entries after the subtree was removed. Prune the detached frame and descendants still mapped to the same owner when the detach reason is not swap, and when the page closes. Fixes browserbase#3240 Co-authored-by: Felix Fang <FelixFangX@users.noreply.github.com>
44a6fc7 to
5549fd2
Compare
Summary
Closing pages with nested frames left stale
frameOwnerPageentries:Page.frameDetacheddeleted only the detached frame id and did not prune descendants still mapped to the same owner.This PR prunes the detached frame and every descendant still owned by the same page on detach (unless
reason === \"swap\"), and applies the same prune on page close before clearing remaining entries for the closed page.Fixes #3240
Test plan
main(NESTED_FRAME/ same-origin grandchildren stayed in the map) and passes with this changedist/not produced by this change)Summary by cubic
Fixes stale
frameOwnerPageentries left behind when frames detach or pages close, so a reused browser context no longer retains ownership of closed pages.swap.Written for commit 5549fd2. Summary will update on new commits.