You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The WindowProxyRemoteValue constructor now takes a WindowProxyProperties parameter, which is a breaking change. Verify that all existing code using this constructor is updated accordingly.
Add the JsonInclude attribute to ensure proper JSON serialization/deserialization of the WindowProxyProperties record, similar to how it's applied to other properties in the RemoteValue classes.
-public record WindowProxyProperties(BrowsingContext.BrowsingContext Context);+using System.Text.Json.Serialization;+public record WindowProxyProperties([JsonInclude] BrowsingContext.BrowsingContext Context);+
Apply this suggestion
Suggestion importance[1-10]: 7
__
Why: Adding the JsonInclude attribute is important for consistent serialization behavior across the codebase. Other similar properties in RemoteValue classes use this attribute, and maintaining this pattern ensures proper JSON handling for the new WindowProxyProperties record.
Medium
Learned best practice
Add null validation for required constructor parameters to prevent NullReferenceException at runtime
The constructor parameter Value is implicitly required but lacks null validation. Add a null check using ArgumentNullException.ThrowIfNull() to ensure that the Value parameter is not null before using it.
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
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
Motivation and Context
Contributes to #15407
Types of changes
Checklist
PR Type
Enhancement
Description
Decoupled
WindowProxyPropertiesinto a standalone class for better modularity.Replaced nested
Propertiesrecord withWindowProxyPropertiesinWindowProxyRemoteValue.Improved code maintainability and future extensibility by avoiding nested DTO types.
Changes walkthrough 📝
RemoteValue.cs
Refactored `WindowProxyRemoteValue` to use standalone propertiesdotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs
Propertiesrecord withWindowProxyProperties.WindowProxyRemoteValueto use the newWindowProxyProperties.Propertiesrecord definition.WindowProxyProperties.cs
Introduced standalone `WindowProxyProperties` recorddotnet/src/webdriver/BiDi/Modules/Script/WindowProxyProperties.cs
WindowProxyPropertiesrecord.Contextproperty withinWindowProxyProperties.