Draft is no longer automatically saved after you cancel replying

AI-generated summary

A user reported a bug where drafts are no longer automatically saved after canceling a reply action while viewing a different topic 1. The issue occurs when a user starts drafting, navigates away, clicks reply, selects cancel in the modal, and then resumes typing; subsequent saves or page reloads result in the loss of text written after the cancellation. The reporter provided steps to reproduce the issue and a video demonstration 1. Another user attempted to reproduce the bug but was initially unsuccessful 2. A developer confirmed they could reproduce the issue and began working on a fix 3. The problem was identified as the system pausing draft saving when the modal dialog opened but failing to resume it upon closing 4. The fix has been merged into the codebase 4.

This is very similar to Draft is no longer automatically saved after you click 'keep editing'

Today, I lost a part of my draft again because of a very similar pattern. Autosave doesn’t seem to work after you click reply and then cancel while you were looking at a topic different from the one you replied to.

Steps to reproduce:

  1. Start drafting a reply to a topic
  2. Write some text.
  3. Navigate to a different topic while keeping the draft open
  4. Click reply and choose cancel in the modal asking which topic you want to reply to.
  5. Write some more text.
  6. Copy the text you have written or memorize your input.
  7. Reload the page/ close the composer.
  8. Navigate back to the topic you replied to
  9. Open your draft.
  10. Everything written after clicking cancel is missing.

In the video, you can see that pasting some text and reloading works fine. Then, after navigating to a different topic, clicking reply and cancel, the input is not saved and disappears during the reload. But doing the same without using cancel in the modal works fine in the end.

6 Likes

I couldn’t reproduce this yet… I’ll take another shot later this week.

2 Likes

Thanks Moin, I was just able to reproduce this. Will work on a fix.

5 Likes

Okay this has been merged now:

https://github.com/discourse/discourse/pull/35534

We were pausing draft saving when opening that dialog then never resuming when it was closed.

6 Likes