Skip to content

feat: Adding WhatsApp BSUID support to Messages - #361

Merged
superchilled merged 3 commits into
mainfrom
feat-add-whatsapp-bsuid-support-to-messages
Aug 26, 2026
Merged

superchilled merged 3 commits into
mainfrom
feat-add-whatsapp-bsuid-support-to-messages

Conversation

@superchilled

Copy link
Copy Markdown
Contributor

This PR updates the Messages package to add support for sending WhatsApp messages using a BSUID in the to field. Specifically it:

  • Adds a unit test to cover setting a BSUID in the to field of a WhatsApp message object
  • Updates the BaseWhatsapp model to allow the setting of the BSUID in the to field

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Messages WhatsApp models to support using a WhatsApp BSUID as the to recipient identifier (in addition to a phone number), and adds a unit test to cover that scenario.

Changes:

  • Adds a unit test asserting a WhatsApp text message can be serialized with a BSUID in to.
  • Updates the WhatsApp base model to widen the to field type to accept BSUID-style identifiers.

Reviewed changes

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

File Description
messages/tests/test_whatsapp_models.py Adds a new unit test for serializing a WhatsApp text message where to is a BSUID.
messages/src/vonage_messages/models/whatsapp.py Updates BaseWhatsapp.to typing/docs to allow BSUID usage for WhatsApp recipients.
Suppressed comments (1)

messages/src/vonage_messages/models/whatsapp.py:46

  • to is now Union[PhoneNumber, str], but PhoneNumber is already an Annotated[str, Field(pattern=...)]. Adding a plain str to the union makes validation effectively always succeed (any string matches the str branch), so invalid recipients that were previously rejected will now be accepted.
    to: Union[PhoneNumber, str]

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread messages/src/vonage_messages/models/whatsapp.py Outdated
Comment thread messages/tests/test_whatsapp_models.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@superchilled
superchilled merged commit 1d65f2e into main Aug 26, 2026
10 checks passed
@superchilled
superchilled deleted the feat-add-whatsapp-bsuid-support-to-messages branch August 26, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants