Skip to content

feat: flush stored drafts upon message send - #42054

Draft
dougfabris wants to merge 1 commit into
developfrom
feat/draft-on-send
Draft

feat: flush stored drafts upon message send#42054
dougfabris wants to merge 1 commit into
developfrom
feat/draft-on-send

Conversation

@dougfabris

@dougfabris dougfabris commented Sep 4, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Drafts were only written to the server when the composer unmounted, so sending a message left the stored draft untouched and the room kept showing the draft indicator until you switched rooms.

flushDraft now accepts an optional value, and the send handler flushes the composer content once the send flow settles. The composer is empty by then, so the draft is discarded. If the flow deliberately left text behind, a message over Message_MaxAllowedSize for instance, that text is stored as the draft instead. It reuses the same path as the room change flush, so the send handler only needed one extra line.

Issue(s)

Steps to test or reproduce

  1. Type a message in a room, then switch rooms so the draft is saved. The room shows the draft indicator.
  2. Go back to the room and send the message.
  3. The indicator goes away without leaving the room. Reload to confirm the draft is gone on the server.

Further comments

Review in cubic

SCC-31

@dionisio-bot

dionisio-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 901ee24

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dougfabris dougfabris added this to the 8.9.0 milestone Sep 4, 2026
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.31%. Comparing base (bc411ab) to head (901ee24).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #42054      +/-   ##
===========================================
+ Coverage    69.30%   69.31%   +0.01%     
===========================================
  Files         4289     4289              
  Lines       171486   171488       +2     
  Branches     31062    31111      +49     
===========================================
+ Hits        118847   118868      +21     
+ Misses       47463    47442      -21     
- Partials      5176     5178       +2     
Flag Coverage Δ
unit 70.97% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant