Skip to content

fix: properly delete drafts with quoted messages #1573

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

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

isekovanic
Copy link
Contributor

CLA

  • I have signed the Stream CLA (required).
  • Code changes are tested

Description of the changes, What, Why and How?

This PR fixes an issue where drafts containing a quotedMessage were never cleared from the messageComposer state unless manually deleted.

The easiest way to reproduce this is to:

  • Create a draft that contains a quoted message
  • Make sure the draft is there on the server (reload or whatever suits best)
  • Send the draft message from whichever SDK is being used
  • Reload the app again
  • The draft will still be there and no matter how many times we send it it is never going to be removed

The reason this happens is this check, which is used to determine whether a draft should be deleted on pretty much all state listeners in the messageComposer, like so.

However, since we're doing messageComposer.clear() every time we send a message the composite invocation never clears the quoted message state whenever that happens (as seen here and then here).

This in turn causes channel.deleteDraft to never be invoked hence the bug.

Changelog

Copy link
Contributor

Size Change: +11 B (0%)

Total Size: 433 kB

Filename Size Change
dist/cjs/index.browser.cjs 125 kB +3 B (0%)
dist/cjs/index.node.cjs 169 kB +4 B (0%)
dist/esm/index.js 138 kB +4 B (0%)

compressed-size-action

@isekovanic isekovanic merged commit 8c65058 into master Jun 24, 2025
4 checks passed
@isekovanic isekovanic deleted the fix/clearing-draft-with-quoted-message branch June 24, 2025 14:19
github-actions bot pushed a commit that referenced this pull request Jun 24, 2025
## [9.9.0](v9.8.0...v9.9.0) (2025-06-24)

### Bug Fixes

* properly delete drafts with quoted messages ([#1573](#1573)) ([8c65058](8c65058))

### Features

* [CHA-769] add live locations sdk js support ([#1500](#1500)) ([7dcf10d](7dcf10d))
@stream-ci-bot
Copy link

🎉 This PR is included in version 9.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants