Repository navigation
feat(channels): support default audience request flag - #91
Conversation
doistbot
left a comment
There was a problem hiding this comment.
This PR adds an optional, nullable useDefaultRecipients flag to the channel create/update request schemas, with wire-serialization tests covering both true and false for create and update plus empty defaultGroups/defaultRecipients arrays, and a changelog entry — nice groundwork for the comms-cli default-audience feature. No inline issues were flagged; the new field follows the existing nullable/optional schema conventions, serialization through the shared snake-case transport is covered by tests that match the established per-client wire-serialization pattern, and the changelog entry fits the repo's keep-a-changelog style.
I also left one optional follow-up note in the details below.
Optional follow-up note (1)
src/clients/channels-client.test.ts:24: The
suffixtuple element is fully determined bymethod(createChannel→add,updateChannel→update), so the table carries redundant state and the two can drift apart. Derivesuffixfrommethod(or dropmethodand select the call fromsuffix) so there's a single source of truth.
|
Confirmed— |
…dience-prompt # Conflicts: # CHANGELOG.md
## [3.9.0](v3.8.1...v3.9.0) (2026-10-23) ### Features * **channels:** support default audience request flag ([#91](#91)) ([0207cf1](0207cf1))
|
🎉 This PR is included in version 3.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
The channel create and update request schemas already expose
defaultGroupsanddefaultRecipients, which define the groups and individual users selected as a channel default audience. They were missinguseDefaultRecipients, the flag that tells Comms whether to use those values instead of defaulting to everyone in the channel.This adds the missing optional
useDefaultRecipientsfield toCreateChannelArgsandUpdateChannelArgs, completing the existing default-audience request shape.Behavior
useDefaultRecipients: trueactivates the audience indefaultGroupsanddefaultRecipients.useDefaultRecipients: falsedefaults new threads to everyone in the channel.defaultGroupsanddefaultRecipientsarrays clear the saved custom audience.comms-cli use case
This is groundwork for a planned comms-cli default-audience feature. The CLI will be able to configure a custom channel audience by sending
useDefaultRecipients: truewith the selected groups and users, or reset the channel to everyone by sendinguseDefaultRecipients: falsewith empty arrays. With the complete request shape exported by the SDK, that implementation can useCreateChannelArgsandUpdateChannelArgsdirectly without a CLI-specific type workaround.Once released, the CLI should adopt the expected
@doist/comms-sdk@3.9.0release.