Skip to content

fix(ui): skip creating empty drafts - #13711

Open
abhinavohri wants to merge 1 commit into
nextcloud:mainfrom
abhinavohri:fix/skip-empty-drafts
Open

abhinavohri wants to merge 1 commit into
nextcloud:mainfrom
abhinavohri:fix/skip-empty-drafts

Conversation

@abhinavohri

@abhinavohri abhinavohri commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Empty drafts could be created in two cases:

  1. The existing guard checked body.value, but composer data uses bodyHtml or bodyPlain, so an empty body was not detected.
  2. An automatically inserted signature made the body appear non-empty even when the user had not added any content.

This change checks the actual editor content, ignores the automatic signature when determining whether the body is empty, and applies the guard through the shared draft save path used by autosave and closing.

Fixes #13291

The draft guard checked body.value, but composer data uses bodyHtml or bodyPlain. Check the editor content in the shared draft save path and ignore automatic signatures.

Assisted-by: Codex:gpt-5
Signed-off-by: Abhinav Ohri <abhinavohri13@gmail.com>
@abhinavohri

Copy link
Copy Markdown
Contributor Author

One related case remains unchanged:

If a user enters some content and waits for autosave, a draft is created. If they then remove all content and close the composer, the existing draft remains because it has already been saved.

Should an existing draft be deleted when the composer becomes completely empty?

This branch has not been deployed

No deployments
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.

Do not save empty mails as draft

1 participant