-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[dotnet][bidi] Use subscription id for events to unsubscribe #15251
Conversation
PR Reviewer Guide 🔍(Review updated until commit b67ebbc)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to b67ebbc
Previous suggestions✅ Suggestions up to commit 4ecab12
|
Now I should to recall everything in events mechanism to understand whether it can be even more simplified. |
Per slack channel:
Can we add tests on FF? Can we even run this code yet? |
PR is draft, so just waiting when v134 is released. |
Negotiated, works with both v133 and v134. |
User description
Motivation and Context
Finally subscription has
id
managed on remote-end (will be available in chrome/edge/ff v134). I means we don't need to manage a state on client side.Types of changes
Checklist
PR Type
Enhancement
Description
Introduced
Subscription
ID for managing event subscriptions.Updated
Subscribe
andUnsubscribe
methods to useSubscription
ID.Added new classes and converters for handling
Subscription
serialization.Enhanced unsubscribe functionality with attribute-based and ID-based commands.
Changes walkthrough 📝
Broker.cs
Refactored subscription and unsubscription logic
dotnet/src/webdriver/BiDi/Communication/Broker.cs
SubscribeAsync
to returnSubscription
with ID.UnsubscribeAsync
to useSubscription
ID.BiDiJsonSerializerContext.cs
Added serialization for new subscription commands
dotnet/src/webdriver/BiDi/Communication/Json/BiDiJsonSerializerContext.cs
SubscribeResult
.SubscriptionConverter.cs
Added JSON converter for `Subscription`
dotnet/src/webdriver/BiDi/Communication/Json/Converters/SubscriptionConverter.cs
SubscriptionConverter
for JSON serialization.Subscription
objects to/from JSON.SessionModule.cs
Enhanced session module with new subscription methods
dotnet/src/webdriver/BiDi/Modules/Session/SessionModule.cs
SubscribeAsync
to returnSubscribeResult
.SubscribeCommand.cs
Introduced `SubscribeResult` for subscription responses
dotnet/src/webdriver/BiDi/Modules/Session/SubscribeCommand.cs
SubscribeResult
to encapsulateSubscription
ID.Subscription.cs
Introduced `Subscription` class for event management
dotnet/src/webdriver/BiDi/Modules/Session/Subscription.cs
Subscription
class to encapsulate subscription ID.UnsubscribeCommand.cs
Added new commands for enhanced unsubscription
dotnet/src/webdriver/BiDi/Modules/Session/UnsubscribeCommand.cs
UnsubscribeByIdCommand
for ID-based unsubscription.UnsubscribeByAttributesCommand
for attribute-basedunsubscription.
Subscription.cs
Enhanced `Subscription` class with ID-based logic
dotnet/src/webdriver/BiDi/Subscription.cs
Subscription
class to includeSubscription
ID.UnsubscribeAsync
to use the new ID-based logic.