Fix composer deleting newly entered text after deleting draft text #1030
      
        
          +2
        
        
          −77
        
        
          
        
      
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    


🔗 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