Repository navigation
fix(MessageComposer): send an edited bounced message as a new message - #3337
Conversation
A bounced message was never stored by the server, so editing it must send a new message. The submit handler checked the type of the composed message, which the stream-chat composition middleware always sets to "regular", so the edit went to UpdateMessage and failed with 404. The handler now checks the type of the edited message, sends it with the current time and "sending" status, keeps the thread of a reply also sent to the channel and drops the pre-edit snapshot. A reply resent with the same id replaces the old one in the thread instead of duplicating it. Closes REACT-1049 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Size Change: +917 B (+0.08%) Total Size: 1.13 MB 📦 View Changed
ℹ️ View Unchanged
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-v14 #3337 +/- ##
============================================
Coverage 85.89% 85.90%
============================================
Files 524 524
Lines 16649 16660 +11
Branches 5229 5233 +4
============================================
+ Hits 14301 14312 +11
Misses 2348 2348 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
## [14.13.3](v14.13.2...v14.13.3) (2026-10-21) ### Bug Fixes * **Attachment:** render giphy attachments in their own group with uni… ([#3325](#3325)) ([a61c0c4](a61c0c4)) * **Attachment:** render giphy attachments in their own group with unique keys ([b753243](b753243)) * **MessageComposer:** send an edited bounced message as a new message ([#3337](#3337)) ([3f45e67](3f45e67))
|
🎉 This PR is included in version 14.13.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎯 Goal
Editing a message bounced by moderation and submitting it called
UpdateMessage, which failed with 404 because the bounced message was never stored on the server. It should be sent as a new message. Reported in Slack; fixes REACT-1049.🛠 Implementation details
useSubmitHandlerdecided between edit and send by checkinglocalMessage.type !== 'error'on the composed message. Thestream-chatdata-cleanup composition middleware always rewriteserrortoregular, so the check never matched.useSubmitHandlernow checks the type of the composer'seditedMessage, the same check the React Native SDK uses. An editederrormessage is sent as a new message with the same id:sendingstatus, so it is listed at the bottom as sending, not at the old position looking delivered;parent_idwhen edited from the main list;Channel.sendMessageupserts the thread reply withtimestampChanged: true, so a reply resent with the same id replaces the old one instead of being added twice.Not covered: editing a bounced poll message leaves the composer in edit mode, as before.
🎨 UI Changes
None beyond the fixed flow.