Skip to content

Removing async void methods #10438

Closed
@QuaintMako

Description

@QuaintMako

Description

We can find async void methods in the source code. Those methods are associated with fire and forget behaviors. There is no way to wait for their end and response accordingly.

async void methods should be used only for event handling.

Instead, async void should be replaced by async Task.

Concerned code

  • Whole Solution, there is currently 205 occurences of async void.

Gains

  • An ability to use await on async methods we could not before.
  • Removing a code smell from the base.

Requirements

  • If an async void method is detected, make it into a async Task method.
  • Be wary of async void event handlers. They can stay as is.

Comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions