[docs] decision: BiDi events are awaited with expect_* context managers#17671
Open
AutomatedTester wants to merge 1 commit into
Open
[docs] decision: BiDi events are awaited with expect_* context managers#17671AutomatedTester wants to merge 1 commit into
AutomatedTester wants to merge 1 commit into
Conversation
e708379 to
0c1288e
Compare
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💥 What does this PR do?
Proposes a design decision record: BiDi events are awaited with
expect_*context managers.Today the only way to react to a BiDi event is a fire-and-forget callback. To wait for an event triggered by a user action, users must subscribe, act, then wait — which races (the event can fire before the wait starts) and forces everyone to re-implement capture-and-filter boilerplate. This record proposes a race-free, predicate-filtered
expect_*family (arm-before-action context managers) over a small reusableSubscriptionprimitive, consistent across all five bindings, as the foundation the other event-driven decisions (navigation, downloads, user prompts) build on.🔧 Implementation Notes
docs/decisions/process and template introduced in [docs] add design decision record process and template #17665 — depends on [docs] add design decision record process and template #17665 landing (this PR adds onlydocs/decisions/0001-*.md; no conflict with the template/README files).expect_*+Subscriptionwork is implemented and a code PR is pending).🤖 AI assistance
💡 Additional Considerations
Part of a set of BiDi ergonomics decision records proposed together (events, user prompts, storage/cookies, network body+timing, emulation, navigation). This one should be considered first since the others build on the
expect_*primitive it defines. Cross-binding convergence is tracked in the record's binding-status table.🔄 Types of changes