Skip to content
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: handle missing detach events for restored bfcache targets #10967

Merged
merged 1 commit into from Sep 21, 2023

Conversation

OrKoN
Copy link
Collaborator

@OrKoN OrKoN commented Sep 20, 2023

Currently, if we navigate from a page with a worker in an OOPIF to another, we don't get a target detached event for the worker. The session and the target, therefore, continues to be registered as "attached" by Puppeteer. This leads to an issue when on going back to the same page the worker target is double attached. This behaviour is probably caused by the fact that the page is put into a bfcache instead of being actually destroyed. Probably, the correct behaviour from the CDP side would be to keep the client attached to the cached session instead of creating new sessions. Currently, this is not the case so I filed https://crbug.com/1485193.

Closes #10946 #10966

targetInfo.type === 'service_worker' &&
this.#connection.isAutoAttached(targetInfo.targetId)
) {
if (targetInfo.type === 'service_worker') {
Copy link
Collaborator Author

@OrKoN OrKoN Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated change: this condition is redundant because of the check on line 351 (improved for readability)

@OrKoN OrKoN merged commit 7bcdfcb into main Sep 21, 2023
3 checks passed
@OrKoN OrKoN deleted the orkon/fix-bfcache-worker branch September 21, 2023 09:13
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.

None yet

2 participants