Repository navigation
feat: let integrators send a poll with the message by removing the poll-only middleware - #1970
Conversation
…ll-only middleware The poll-only composition middleware, which sends a composer's poll as a message of its own, is now exported with its id, POLL_ONLY_COMPOSITION_MIDDLEWARE_ID. Removing it from a composer's compositionMiddlewareExecutor sends the poll together with the message's text, attachments and quoted message. The default retainCompositionOnSubmit now retains for a poll only while that middleware is installed, so removing it also clears the composer after the send instead of keeping content that already went out. With the default chain nothing changes.
isekovanic
left a comment
There was a problem hiding this comment.
Is this something an integrator has asked for before ? I think it has additional implications (nothing breaking of course) btu you've probably thought about it more than I have :D
Has the backend been checked with poll_id, attachments and quoted_message_id on the same message ?
…thread The default retainCompositionOnSubmit now retains only when the poll-only middleware sends the poll alone: a poll is set, the composer is not editing a message or composing a thread reply, and the middleware is installed. Previously, updating a message that has a poll kept the composer in edit mode with the edited text, and a thread reply carrying a poll kept its content.
Yes, it works. There is no blocking from the server side. |
isekovanic
left a comment
There was a problem hiding this comment.
Update the ai docs as well when you have the chance to, I think the info there might be stale
## [10.0.0-rc.29](v10.0.0-rc.28...v10.0.0-rc.29) (2026-11-02) ### Features * let integrators send a poll with the message by removing the poll-only middleware ([#1970](#1970)) ([b515849](b515849)), closes [GetStream/stream-chat-react#3365](GetStream/stream-chat-react#3365)
|
🎉 This PR is included in version 10.0.0-rc.29 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Ticket: https://linear.app/stream/issue/REACT-1441/make-messagecomposerpreviews-composable-like-the-message-action-set
CLA
Description of the changes, What, Why and How?
What: an integrator can now send a composer's poll together with the message's text, attachments and quoted message. Until now the poll always went out as a message of its own, and the drafted text stayed in the composer.
How: remove the poll-only step from the composer's composition chain. This adds no new config field or composer method:
createPollOnlyCompositionMiddlewareandPOLL_ONLY_COMPOSITION_MIDDLEWARE_IDare now exported, so the step can be removed and put back.retainCompositionOnSubmitkeeps the composer's contents for a poll only while the poll-only step is installed. Removing the step therefore also clears the composer after the send. Without this, the attachments step would leave out attachments the composer keeps, so they would not be sent.Why: the React SDK's composer can show an attached poll next to the text and attachments (GetStream/stream-chat-react#3365). This makes it possible to send them as one message.
Changelog