Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Jun 25, 2025

When not running in production, the new UseConsole can be used to support scenarios where the CLI falls short, such as sharing contacts, image or other media. In these cases, if the UseConsole is added after the UseConversation handler, you can get responses for messages in both WhatsApp as well as the CLI, provided a previous conversation in the time window came from the console (to establish its service url).

When not running in production, the new `UseConsole` can be used to support scenarios where the CLI falls short, such as sharing contacts, image or other media. In these cases, if the `UseConsole` is added after the `UseConversation` handler, you can get responses for messages in both WhatsApp as well as the CLI, provided a previous conversation in the time window came from the console (to establish its service url).
@kzu kzu added the enhancement New feature or request label Jun 25, 2025
@kzu kzu enabled auto-merge (rebase) June 25, 2025 19:06
@kzu kzu requested a review from Copilot June 25, 2025 19:06
@kzu kzu disabled auto-merge June 25, 2025 19:06
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 introduces a new feature that enables seamless continuity between CLI and WhatsApp by incorporating the UseConsole option. The changes update responses (Typing, Text, and Reaction) to handle composite services, add a console handler for non‑production environments, and update sample and test code accordingly.

Reviewed Changes

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

Show a summary per file
File Description
src/WhatsApp/TypingResponse.cs Adds support for CompositeService in typing responses.
src/WhatsApp/TextResponse.cs Updates text response to send dual replies using a composite service when available.
src/WhatsApp/ReactionResponse.cs Applies composite service logic to reaction responses.
src/WhatsApp/MessageExtensions.cs Adjusts extension methods to incorporate the new overloads for composite services.
src/WhatsApp/ConsoleHandlerExtensions.cs Introduces a new console handler extension for development scenarios.
src/WhatsApp/CompositeService.cs Creates a new record for handling composite service scenarios.
src/Tests/WhatsAppClientTests.cs Modifies tests to reflect updated ReplyAsync parameter ordering for composite service handling.
src/SampleApp/Sample/Program.cs Updates sample app configuration to include the UseConsole middleware.
readme.md Enhances documentation with instructions for using the new UseConsole feature.
Comments suppressed due to low confidence (2)

src/WhatsApp/TextResponse.cs:25

  • Invoking SendReplyAsync twice when a composite service is available results in two separate responses. Confirm that this dual-response behavior is intentional and consider adding documentation to clarify the design.
        if (service != null)

src/Tests/WhatsAppClientTests.cs:59

  • The parameter ordering in the ReplyAsync call has been updated to align with the new composite service behavior. Verify that this change is consistent with the updated API design and that the tests correctly reflect the intended message routing.
            from,

@kzu
Copy link
Member Author

kzu commented Jun 25, 2025

37 passed 37 passed 8 skipped

🧪 Details on Ubuntu 24.04.2 LTS

from dotnet-retest v0.7.1 on .NET 8.0.17 with 💜 by @devlooped

@kzu kzu merged commit 17ac7ad into main Jun 25, 2025
7 checks passed
@kzu kzu deleted the dev/Continuity branch June 25, 2025 19:09
@devlooped devlooped locked and limited conversation to collaborators Jul 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants