Skip to content

Conversation

nvborisenko
Copy link
Member

@nvborisenko nvborisenko commented Oct 17, 2025

User description

https://w3c.github.io/webdriver-bidi/#type-network-dataType

💥 What does this PR do?

Support new Request data type according specification.

🔧 Implementation Notes

No internal tests yet, no stable browsers support it. But changes are simple, letting users to experiment with beta browsers.

🔄 Types of changes

  • New feature (non-breaking change which adds functionality and tests!)

PR Type

Enhancement


Description

  • Add Request data type to Network module enum

  • Enables BiDi protocol support for request data collection

  • Aligns with W3C WebDriver BiDi specification


Diagram Walkthrough

flowchart LR
  DataType["DataType enum"]
  Request["Request variant"]
  Response["Response variant"]
  DataType --> Request
  DataType --> Response
Loading

File Walkthrough

Relevant files
Enhancement
AddDataCollectorCommand.cs
Add Request enum value to DataType                                             

dotnet/src/webdriver/BiDi/Network/AddDataCollectorCommand.cs

  • Added Request enum value to DataType enum
  • Positioned before existing Response value
  • Enables request data collection in BiDi Network module
+1/-0     

@selenium-ci selenium-ci added the C-dotnet .NET Bindings label Oct 17, 2025
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
- [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true -->

</details></td></tr>
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Explicitly assign enum integer values

Explicitly assign integer values to the DataType enum members (Request = 0,
Response = 1) to prevent accidental value changes and potential bugs from future
reordering.

dotnet/src/webdriver/BiDi/Network/AddDataCollectorCommand.cs [44-48]

 public enum DataType
 {
-    Request,
-    Response
+    Request = 0,
+    Response = 1
 }
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that adding a new enum member changes the implicit value of existing members, which is a potential source of bugs. Explicitly assigning values is a best practice that improves code robustness and maintainability.

Medium
  • More

@nvborisenko nvborisenko merged commit f7c6590 into SeleniumHQ:trunk Oct 17, 2025
13 checks passed
@nvborisenko nvborisenko deleted the bidi-request-datatype branch October 17, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants