Skip to content

[dotnet] [bidi] Decouple ChannelProperties in Script module #15489

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

Merged
merged 1 commit into from
Mar 23, 2025

Conversation

nvborisenko
Copy link
Member

@nvborisenko nvborisenko commented Mar 23, 2025

User description

Motivation and Context

Contributes to #15407

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Enhancement


Description

  • Decoupled ChannelProperties from ChannelLocalValue in the Script module.

  • Introduced a standalone ChannelProperties record in a new file.

  • Simplified and improved maintainability of ChannelLocalValue.


Changes walkthrough 📝

Relevant files
Enhancement
ChannelProperties.cs
Introduced standalone `ChannelProperties` record                 

dotnet/src/webdriver/BiDi/Modules/Script/ChannelProperties.cs

  • Added a new ChannelProperties record.
  • Defined properties SerializationOptions and Ownership.
  • Created a standalone file for better modularity.
  • +27/-0   
    LocalValue.cs
    Refactored `ChannelLocalValue` to use standalone `ChannelProperties`

    dotnet/src/webdriver/BiDi/Modules/Script/LocalValue.cs

  • Replaced nested ChannelProperties with standalone version.
  • Removed the nested ChannelProperties definition.
  • Updated ChannelLocalValue to use the new ChannelProperties.
  • +1/-8     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis ✅

    15407 - PR Code Verified

    Compliant requirements:

    • Moving nested DTO type ChannelLocalValue.ChannelProperties to a standalone ChannelProperties type

    Requires further human verification:

    • Verify if there are other nested types in the codebase that should be decoupled as part of this ticket
    • Check if the PR maintains backward compatibility or if breaking changes are properly documented
    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Incomplete Refactoring
    The PR decouples ChannelProperties but leaves a TODO comment in ChannelLocalValue. This comment should be addressed or explained as part of the refactoring.

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Remove unclear TODO comment

    The type field is marked with a TODO comment but appears to be important for
    JSON serialization. Consider documenting its purpose clearly or removing the
    TODO comment if the field is necessary for proper serialization.

    dotnet/src/webdriver/BiDi/Modules/Script/ChannelLocalValue.cs [93-98]

     public record ChannelLocalValue(ChannelProperties Value) : LocalValue
     {
    -    // TODO: Revise why we need it
         [JsonInclude]
         internal string type = "channel";
     }

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 3

    __

    Why: The suggestion correctly identifies an unclear TODO comment that could be removed for cleaner code. While valid, this is a minor improvement that doesn't affect functionality, just code clarity.

    Low
    • More

    @nvborisenko nvborisenko merged commit 2be9609 into SeleniumHQ:trunk Mar 23, 2025
    10 checks passed
    @nvborisenko nvborisenko deleted the bidi-nested-channel branch March 23, 2025 20:20
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants