Skip to content

Async method naming: Task-returning methods missing Async suffix #110

@Christophe-Rogiers

Description

@Christophe-Rogiers

Bug Description

Several methods returning Task<T> do not follow the established Async suffix convention used elsewhere in the codebase. The same project uses SearchDomainServicesAsync, GetByNameAsync, UpdateAsync — but similar async methods omit the suffix.

Actual Behavior

// IServiceManager.cs lines 24-54
Task<bool> InstallService(...);
Task<bool> UninstallService(...);
Task<bool> StartService(...);
Task<bool> StopService(...);
Task<bool> RestartService(...);

// IServiceRepository.cs line 106
Task<IEnumerable<ServiceDto>> Search(...);

Meanwhile, the same interface uses:

// IServiceRepository.cs line 207
Task<IEnumerable<Service>> SearchDomainServicesAsync(...);

Additionally, async void is used in the UI layer instead of async Task:

// ServiceCommands.cs
public async void StartService(...)
public async void StopService(...)
public async void RestartService(...)

The async void pattern is particularly problematic — exceptions cannot be caught or awaited by callers.

Expected Behavior

All Task<T>-returning methods should consistently use the Async suffix, matching the pattern already established in the repository layer. UI event handlers using async void should be reviewed for proper exception handling.

Environment

  • Files: src/Servy.Core/Services/IServiceManager.cs, src/Servy.Core/Data/IServiceRepository.cs, src/Servy/Services/ServiceCommands.cs
  • Lines: IServiceManager 24-54, IServiceRepository 106, ServiceCommands StartService/StopService/RestartService

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions