-
Couldn't load subscription status.
- Fork 225
Fix composer deleting newly entered text after deleting draft text #3854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix composer deleting newly entered text after deleting draft text #3854
Conversation
…vious text from draft
WalkthroughThe PR removes the automatic clearing of composer content when a DraftDeletedEvent is received. This fixes a bug where newly entered text was inadvertently deleted alongside draft content, eliminating the problematic event-handling logic and its corresponding tests. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes The changes consist of homogeneous removals across two event handlers and two corresponding test cases. The logic being removed is straightforward, requiring minimal reasoning per file. The pattern is consistent throughout, and the scope is well-contained. Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
SDK Performance
|
SDK Size
|
StreamChatUI XCSize
|
Public Interface🚀 No changes affecting the public interface. |
|



🔗 Issue Links
https://linear.app/stream/issue/IOS-1201/swiftui-deleting-a-draft-clears-newly-entered-text
🎯 Goal
Fix composer deleting newly entered text after deleting draft text.
🛠 Implementation
For now, we are going to remove the synchronisation of deleting the draft from the event while the channel is open. (The draft will still be deleted in the local state, but it won't be reflected in the composer if the channel is open). This use case is very rare; if you have 2 devices opened in the same channel, and from one of the devices you delete the draft, you probably don't care if the composer on the other device also gets deleted. You can simply delete it yourself.
The only way to properly solve this issue is if the deleted event contained the draft text that was deleted, so that we are sure we only delete drafts in the composer if the text still matches. At the moment, we don't have this. The issue is recorded on the backend here. But for now, better to remove this handling since it is causing serious harm for something that is not really useful.
🧪 Manual Testing Notes
☑️ Contributor Checklist
docs-contentrepo