-
-
Notifications
You must be signed in to change notification settings - Fork 2
Refactored handlers to return async enum responses #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ca29304 to
9b4dba0
Compare
There was a problem hiding this 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.
There was a problem hiding this 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 pull request refactors the WhatsApp handlers to return asynchronous enumerable responses, enhancing flexibility and scalability in message processing. Key changes include the transition from Task-based to IAsyncEnumerable-based handler methods, the propagation of cancellation tokens in client operations, and updates in test and sample implementations to work with async enumerables.
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/WhatsApp/WhatsAppHandler.cs | Refactored handler implementation to return IAsyncEnumerable. |
| src/WhatsApp/WhatsAppClientExtensions.cs | Updated extension methods to include cancellation tokens and adjust parameter signatures. |
| src/WhatsApp/WhatsAppClient.cs | Added cancellation token propagation in SendAsync operations. |
| src/WhatsApp/OpenTelemetryHandler.cs | Updated error handling via WithErrorHandlingAsync in the tracing handler. |
| src/SampleApp/Sample/Program.cs | Modified sample app to iterate asynchronous responses and updated service configuration. |
Comments suppressed due to low confidence (1)
src/WhatsApp/WhatsAppClientExtensions.cs:6
- The accessibility of the WhatsAppClientExtensions class was changed from public to internal by removing the public modifier. Confirm that this intentional change will not restrict its usage across assemblies if it was designed to be a public API.
static partial class WhatsAppClientExtensions
In preparation for adding the storage handler.
bb2241b to
73bb13a
Compare
Purpose of the Pull Request
The purpose of this pull request is to refactor the handlers in the WhatsApp project to return asynchronous enumerable responses. This change prepares the codebase for adding a storage handler, improving the flexibility and scalability of the message-handling pipeline.
Impact and Potential Risks
This pull request involves significant changes across multiple files, including modifications to the message-handling logic, interfaces, and tests. The use of asynchronous enumerables may introduce risks related to error handling and cancellation token propagation, as highlighted in the discussions. However, these changes align with modern asynchronous programming practices, which should improve performance and resource usage.