fix(channels): allow whatsapp native mode with use_native flag#2934
Open
dtapps wants to merge 2 commits into
Open
fix(channels): allow whatsapp native mode with use_native flag#2934dtapps wants to merge 2 commits into
dtapps wants to merge 2 commits into
Conversation
When type is 'whatsapp' and use_native is true, the channel should be considered configured even if bridge_url is empty. This aligns with the documentation which states users can set use_native: true and leave bridge_url blank for native mode. Fixes the issue where whatsapp channel with use_native: true was not starting because the configuration check only looked for bridge_url.
When type is 'whatsapp' and use_native is true, dynamically switch to using the 'whatsapp_native' factory instead of the bridge factory. This allows users to configure: type: 'whatsapp' use_native: true And have it automatically use the native whatsmeow implementation, without needing to change the type to 'whatsapp_native'. This aligns the behavior with the existing documentation.
Collaborator
|
The "effective channel type" is only corrected in With In practice, this PR introduces an inconsistent state: initialized says I would centralize the resolution of the effective type into a shared helper and reuse it for factory lookup, runtime events, and worker creation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Fix WhatsApp channel configuration detection to support native mode with
use_native: true.Currently, when
type: "whatsapp"is set, the channel is only considered configured ifbridge_urlis not empty. This prevents the native mode (whatsmeow) from working when users setuse_native: trueand leavebridge_urlblank, as documented.The fix changes the validation logic to accept either:
bridge_url != ""(Bridge mode)use_native == true(Native mode)🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
📚 Technical Context (Skip for Docs)
"use_native": trueand leavebridge_urlblank for native mode, but the code only checked forbridge_url. This caused the WhatsApp channel to not start when configured for native mode.🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
Before fix:
(WhatsApp channel not started despite being enabled with
use_native: true)After fix:
WhatsApp channel starts correctly when
use_native: trueis set withoutbridge_url.☑️ Checklist