Skip to content

[🐛 Bug]: Async methods cannot be easily recognized #12671

@nvborisenko

Description

@nvborisenko

What happened?

We cannot easily understand whether a method is asynchronous or not. When we write code, we use synchronous methods and asynchronous beside. There is high chance to make a mistake when dealing with async methods, and don't await them.

Example:

driver.Network.StartMonitoring();

Who knows it's async or not. Tooling (like IDE) doesn't help us (at least for me) to understand, there is even no warnings.

Even Jim made a mistake:
image

I also went through open issues in this repository and observed that people don't await StartMonitoring() method.

Solution

Add Async to all async methods according naming convention.

By convention, methods that return commonly awaitable types (for example, Task, Task, ValueTask, ValueTask) should have names that end with "Async".

How can we reproduce the issue?

driver.Network.StartMonitoring();

Relevant log output

no output

Operating System

any

Selenium version

any dotnet, selenium 4.0+

What are the browser(s) and version(s) where you see this issue?

any

What are the browser driver(s) and version(s) where you see this issue?

any

Are you using Selenium Grid?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs decisionTLC needs to discuss and agreeC-dotnet.NET BindingsI-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions