Skip to content

Conversation

@vbreuss
Copy link
Member

@vbreuss vbreuss commented Nov 12, 2025

This PR refactors async methods to follow the best practice of wrapping parameter validation in a synchronous outer method with an inner async implementation. This pattern ensures that parameter validation (like null checks) happens immediately when the method is called, rather than being deferred until the async state machine starts executing.

Key Changes:

  • Async methods are split into synchronous outer methods that perform parameter validation and asynchronous inner implementation methods
  • Parameter validation exceptions are thrown synchronously before any async operations begin
  • Inner async methods use abbreviated parameter names to avoid closure capture of outer parameters

@vbreuss vbreuss self-assigned this Nov 12, 2025
Copilot AI review requested due to automatic review settings November 12, 2025 11:18
@vbreuss vbreuss added the refactor A change or improvement without functional impact label Nov 12, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors async methods to follow the best practice of wrapping parameter validation in a synchronous outer method with an inner async implementation. This pattern ensures that parameter validation (like null checks) happens immediately when the method is called, rather than being deferred until the async state machine starts executing.

Key Changes:

  • Async methods are split into synchronous outer methods that perform parameter validation and asynchronous inner implementation methods
  • Parameter validation exceptions are thrown synchronously before any async operations begin
  • Inner async methods use abbreviated parameter names to avoid closure capture of outer parameters

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ZipArchiveWrapper.cs Refactored two ExtractToDirectoryAsync overloads to use the validation-wrapping pattern with local async functions
ZipArchiveEntryWrapper.cs Refactored two ExtractToFileAsync overloads to use the validation-wrapping pattern with local async functions

@vbreuss vbreuss enabled auto-merge (squash) November 12, 2025 11:19
@sonarqubecloud
Copy link

@vbreuss vbreuss merged commit e82d50c into main Nov 12, 2025
12 of 13 checks passed
@vbreuss vbreuss deleted the topic/fix-sonar-issues branch November 12, 2025 11:58
@github-actions
Copy link

This is addressed in release v5.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor A change or improvement without functional impact state: released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants