Skip to content

Conversation

@javorosas
Copy link
Member

This pull request introduces several breaking changes and new features in preparation for version 5.0.0. The main focus is on improving testability, resource management, and request cancellation support across the client library. The most significant updates include making wrapper constructors internal, introducing a new client interface for easier mocking, implementing IDisposable for proper HTTP resource cleanup, and adding optional CancellationToken parameters to client methods.

Breaking changes and API surface improvements

  • Wrapper classes (e.g., CustomerWrapper, ProductWrapper) can no longer be constructed directly; their constructors are now internal and require an HttpClient instance, enforcing usage through FacturapiClient. (FacturapiClient.cs, Wrappers/CustomerWrapper.cs, Wrappers/CatalogWrapper.cs, [1] [2] [3]
  • Introduced the IFacturapiClient interface, allowing consumers to mock the client for testing purposes. (IFacturapiClient.cs, IFacturapiClient.csR1-R18)
  • FacturapiClient now implements IDisposable. Consumers should call Dispose() or use a using statement to ensure HTTP resources are released promptly. (FacturapiClient.cs, [1] [2]

Request cancellation and async improvements

  • All async methods in wrapper classes now accept optional CancellationToken parameters, enabling callers to cancel in-flight requests. (Wrappers/CustomerWrapper.cs, Wrappers/CatalogWrapper.cs, [1] [2]
  • Internal HTTP calls and error handling have been updated to propagate cancellation tokens and throw if cancellation is requested. (Wrappers/BaseWrapper.cs, [1] [2]

Documentation and versioning

  • Updated CHANGELOG.md to reflect the new version (5.0.0), highlight breaking changes, and document the new features and improvements. [1] [2]

This comment was marked as resolved.

Copy link
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

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

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Base automatically changed from FAC-1703/feat/add-status-field-on-error-object to main December 11, 2025 18:02
@javorosas javorosas merged commit 3782aa1 into main Dec 11, 2025
@javorosas javorosas deleted the feat/improve-resource-cleanup branch December 11, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants