“c” shortcut causes draft conflict when creating another topic from a topic page

AI-generated summary

This bug report details a draft conflict issue on Discourse when using the c keyboard shortcut to create multiple new topics from an existing topic page. profcaju explains that after saving and closing the first new-topic draft, pressing c again to start a second topic triggers a false “draft is being edited in another window” warning and results in an HTTP 409 error during autosave. The user identifies the root cause as the fallback logic in KeyboardShortcuts#createTopic, which reuses the fixed Composer.NEW_TOPIC_KEY without generating a unique draftSequence, unlike the standard composer.openNewTopic() method. This causes both drafts to compete for the same storage key. zogstrip confirmed the issue and noted it has been resolved by pull request #44944.

I can reproduce a draft conflict on meta.discourse.org when creating two new-topic drafts using the native c keyboard shortcut while viewing an existing topic.

Steps to reproduce

  1. Open an existing public topic.
  2. Press c to create a new topic.
  3. Enter a title and body.
  4. Wait for the draft to save, then click the composer’s Save and close button (X).
  5. While still viewing an existing topic, press c again to create another new topic.
  6. Enter a different title.
  7. Press Tab to move from the title field to the message body and wait for autosave.

Both new-topic composers must be opened while viewing an existing topic for the reproduction I confirmed on Meta.

Actual result

A warning appears saying that the draft is being edited in another window and asking me to reload the page.

This happens without editing the draft in another window.

On my own site, the failed autosave request to /drafts.json returns HTTP 409.

Expected result

The second new topic should get its own draft, preserving the first saved draft without a conflict.

Where I reproduced it

  • On meta.discourse.org, following the steps above.
  • On my own site in Safe Mode, with themes and all client-side plugin customizations disabled.
  • My site runs Discourse 2026.10.0-latest, commit b28f2a44c.

Possible cause

Code inspection suggests that the fallback in KeyboardShortcuts#createTopic still uses the fixed Composer.NEW_TOPIC_KEY (new_topic) and does not supply a draftSequence:

By comparison, composer.openNewTopic() generates a unique draft key.

In the reproduction captured on my site, the first draft was saved under new_topic and reached sequence 1. The second composer attempted to save under the same key without a sequence, resulting in HTTP 409 and the warning.

Could this fallback use composer.openNewTopic() so that each new topic gets a separate draft?

Kind regards,
Prof. Caju

1 Like

thanks for the report @profcaju :+1:

will be fixed by

4 Likes