Skip to content

Conversation

@nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Oct 23, 2025

🔗 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

  1. Open a channel
  2. Enter text
  3. Leave channel
  4. Open the same channel, draft message is there
  5. Select all, delete
  6. Quickly type new text
  7. Should not delete new text

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@nuno-vieira nuno-vieira requested a review from a team as a code owner October 23, 2025 11:23
Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but there are some checks failing that need to be checked

@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChatSwiftUI 9.58 MB 9.58 MB -1 KB 🚀

@Stream-SDK-Bot
Copy link
Collaborator

StreamChatSwiftUI XCSize

Object Diff (bytes)
MessageComposerViewModel.o -296

@github-actions
Copy link

Public Interface

🚀 No changes affecting the public interface.

@sonarqubecloud
Copy link

@nuno-vieira nuno-vieira enabled auto-merge (squash) October 23, 2025 14:04
@nuno-vieira nuno-vieira merged commit 5f7faa6 into develop Oct 23, 2025
11 checks passed
@nuno-vieira nuno-vieira deleted the fix/composer-new-input-text-deleted-after-deleting-draft branch October 23, 2025 14:47
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