Open Bug 1799098 Opened 2 years ago Updated 2 years ago

Do not clear log entryAdded event buffer on reload

Categories

(Remote Protocol :: WebDriver BiDi, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:backlog])

See https://github.com/web-platform-tests/wpt/pull/36588 which will be merged to m-c via Bug 1796769.

In our initial implementation for log.entryAdded, we assumed the buffered entryAdded events only had to be provided for the "live" browsing contexts. But the current state of the spec says that we should buffer all events, and they should only be cleared when subscribing.

From the end of https://w3c.github.io/webdriver-bidi/#event-log-entryAdded , the only buffered events to omit are those for which getting a browsing context given context id returns an error. But since context id is stable across navigation, this will only be the case for frames or for top level BC which are fully destroyed (ie tab/window was closed).

When the test PR is synced, a few tests will fail on our side (event_buffer.py's test_console_log_cached_message_after_refresh and entry_added/subscription.py's test_subscribe_unsubscribe), but there is another issue opened to make the spec match the initial implementation we had in Firefox at https://github.com/w3c/webdriver-bidi/issues/312 so we should probably wait until this has been discussed before deciding to update our implementation.

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(hskupin)
Severity: -- → S3
Points: --- → 2
Priority: -- → P2
Whiteboard: [webdriver:backlog]
Flags: needinfo?(hskupin)
Points: 2 → ---

Added a comment at https://github.com/w3c/webdriver-bidi/issues/312#issuecomment-1331865972 but this seems very difficult to properly support without adding a lot of overhead. Regardless of what the platform can store in terms of log entries, the need to serialize the log event (including arguments, realm information, etc...) might require to monitor all log events in all browsing contexts as soon as the BiDi session starts.

We would need to generate the realm ids and to serialize potential arguments while the realm is still alive.

Whiteboard: [webdriver:backlog] → [webdriver:backlog][webdriver:triage]

Given that the buffer is implementation specific in theory, pruning on reload is in theory spec compliant, so we can downgrade this to P3 as we are only failing a single test and that would be challenging to implement.

Priority: P2 → P3
Whiteboard: [webdriver:backlog][webdriver:triage] → [webdriver:backlog]
Blocks: 1719287
No longer blocks: 1724669
You need to log in before you can comment on or make changes to this bug.