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

AI-generated summary

profcaju reports a bug where using the native c keyboard shortcut to create multiple new-topic drafts while viewing an existing topic results in a draft conflict. The issue occurs when the user creates a draft, saves and closes it, then creates a second draft; the autosave for the second draft fails with an HTTP 409 error, triggering a warning that the draft is being edited in another window, despite no other window being involved.

The user reproduced this on meta.discourse.org and their own site running Discourse 2026.10.0-latest in Safe Mode. The expected behavior is for each new topic to have its own draft without conflict.

profcaju identifies the likely cause in the KeyboardShortcuts#createTopic fallback, which uses a fixed Composer.NEW_TOPIC_KEY (new_topic) without supplying a draftSequence. In contrast, composer.openNewTopic() generates a unique draft key. The first draft is saved under new_topic with sequence 1, and the second attempt to save under the same key without a sequence causes the conflict. The user suggests updating the fallback to use composer.openNewTopic() to ensure each new topic gets a separate draft.

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:

https://github.com/discourse/discourse/blob/ec4cea91ea81d926cedab5f0d61c9313f42aba24/frontend/discourse/app/services/keyboard-shortcuts.js#L565-L569

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