All MessageHandler event subscriptions should come from SessionData
Categories
(Remote Protocol :: WebDriver BiDi, task, P1)
Tracking
(firefox106 fixed)
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
Details
(Whiteboard: [webdriver:m4])
Attachments
(3 files)
After Bug 1783177, we will no longer have internal & protocol events. However, event subscription is still inconsistent. The events coming form content processes are using session data to start their listeners (example). However events subscribed from the parent process completely bypass SessionData and directly create subscribers after receiving a specific internal command called _subscribeEvent
(example).
This makes it hard to share more logic for events. Ideally all events would be driven and tracked from a single place (EventsDispatcher) and fully stored in SessionData.
This bug is about extending SessionData updates so that they can also reach root modules. This way root modules can implement event handling in almost the same way as windowglobal modules.
There is of course a catch. For windowglobal modules, the "scope" of the listener is usually the scope of the windowglobal itself. However for modules in the root layer, they will need to check the context descriptor for which a given event is set. So there will be some additional complexity when comparing to a simple windowglobal event.
Assignee | ||
Comment 1•2 years ago
|
||
Depends on D155025
The current version returns the return value of the command (which can be a broadcast, depending on the provided descriptor).
This makes it impossible to know what to consistently expect as a return value.
It seems it was only used for a test assertion, so rewrite the test and cleanup the return value
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D155059
In order for all events to really use similar codepaths, they should not use different subscription mechanism.
Setting an event in SessionData should be the entry point for all modules to decide to update their listeners or not.
Therefore we will also call _applySessionData on root modules which support this.
Next patch will start using this for the browsingContext.contextCreated event.
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D155060
The _subscribe/_unsubscribeEvent can be removed in the next patch
Comment 4•2 years ago
|
||
Julian, how many points should we account for this bug?
Assignee | ||
Comment 5•2 years ago
|
||
I think 2 points should be fine? Will set for now, feel free to update
Assignee | ||
Updated•2 years ago
|
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/41c91519bd36 [messagehandler] RootMessageHandler _applySessionData should return the session data update r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/cb14a1bf6b01 [messagehandler] Apply session data to Root layer modules r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/824b5bec2bed [messagehandler] Use session data to subscribe to browsingContext.contextCreated r=webdriver-reviewers,whimboo
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/41c91519bd36
https://hg.mozilla.org/mozilla-central/rev/cb14a1bf6b01
https://hg.mozilla.org/mozilla-central/rev/824b5bec2bed
Description
•