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(domworld): reset bindings when context changes (#6766) #6836
Conversation
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.
Ugh I failed to submit this review comment. Jan is already tackling this nit as a follow-up patch
@@ -115,6 +115,7 @@ export class DOMWorld { | |||
|
|||
async _setContext(context?: ExecutionContext): Promise<void> { | |||
if (context) { | |||
this._ctxBindings = new Set(); |
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.
this._ctxBindings = new Set(); | |
this._ctxBindings.clear(); |
it('should persist query handler bindings across navigations', async () => { | ||
const { page, server } = getTestState(); | ||
|
||
// Reset page but make sure that execution context ids start with 1. |
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.
This comment confuses me. How do you assert the ids?
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.
I don't know how how the execution context ids are generated. But it seems like navigating within one origin results in incrementing ids while navigating across origins resets the ids to 1 again. That's why I added the two navigations there.
The previous test just checked by reloading the page which did not reset the ids and therefor did not uncover this edge case.
No description provided.