[dotnet] [bidi] Separate empty and base result #15593
Closed
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.

User description
💥 What does this PR do?
The
EmptyResultdoes two different things: act as a base type for all BiDi results, and act as a void result. We can separate these two responsibilities to two different types, leading to clearer code. Additionally, we can rest assured that anyEmptyResultwe get is not non-empty result without at runtime.PR Type
Enhancement, Other
Description
Replaced
EmptyResultwithBiDiResultas the base type for BiDi command results.Refactored multiple command result classes to inherit from
BiDiResult.Updated serialization and deserialization logic to accommodate the new
BiDiResulttype.Improved code clarity by separating void results (
EmptyResult) from the base result type.Changes walkthrough 📝
25 files
Update command execution to use `BiDiResult`Introduce `BiDiResult` and refactor command baseUpdate JSON serialization for `BiDiResult`Adjust serialization logic for shared referencesUpdate message success handling to use `BiDiResult`Refactor `GetClientWindowsResult` to inherit `BiDiResult`Refactor `GetUserContextsResult` to inherit `BiDiResult`Update `UserContextInfo` to inherit `BiDiResult`Refactor `CaptureScreenshotResult` to inherit `BiDiResult`Update `CreateResult` to inherit `BiDiResult`Refactor `GetTreeResult` to inherit `BiDiResult`Update `LocateNodesResult` to inherit `BiDiResult`Refactor `NavigateResult` to inherit `BiDiResult`Update `PrintResult` to inherit `BiDiResult`Refactor `TraverseHistoryResult` to inherit `BiDiResult`Update `AddInterceptResult` to inherit `BiDiResult`Refactor `AddPreloadScriptResult` to inherit `BiDiResult`Update `EvaluateResult` hierarchy to inherit `BiDiResult`Refactor `GetRealmsResult` to inherit `BiDiResult`Update `NewResult` to inherit `BiDiResult`Refactor `StatusResult` to inherit `BiDiResult`Update `SubscribeResult` to inherit `BiDiResult`Refactor `DeleteCookiesResult` to inherit `BiDiResult`Update `GetCookiesResult` to inherit `BiDiResult`Refactor `SetCookieResult` to inherit `BiDiResult`