"composer was opened without a draft key"

this came up a few times, but, was unable to get it to do it on purpose. only thing consistent was that i was on mobile. i have the latest update(s).

1 Like

Does it happen in safe mode on that site?

I have also had reports of this error on my site sporadically for the last few months. I’ve been unable to track down the cause or any way to reproduce it myself. Apparently it occurs on iOS when clicking the new topic button.

I realise that’s not particularly helpful, but maybe it rules out any specific customisations @8BIT has in place.

2 Likes

i can’t seem to replicate it consistently enough, but, i do not think so…

This is your alert @sam any diagnostic ideas?

2 Likes

I’ve managed to reproduce this consistently on mobile

  1. Visit https://meta.discourse.org/categories, refresh the page
  2. Navigate to Latest
  3. Click New Topic
  4. Error occurs

Navigating to another page resolves the issue. Here’s a video of the process:

7 Likes

Marking this as a bug with a pr-welcome now that we have a clear repro.

4 Likes

I will take it as Im currently facing the same kind of bug with the new reply select kit component, and Im digging through this code.

6 Likes

So this is coming from here:

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/routes/discovery-categories.js.es6#L15

const style = !this.site.mobileView && this.siteSettings.desktop_category_page_style;

So on mobile we are calling promise = CategoryList.listForParent(this.store, parentCategory); while on desktop we are calling promise = this._loadCategoriesAndLatestTopics(); which is effectively setting the draft_key: https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/routes/discovery-categories.js.es6#L49

I went with this easy fix:

https://github.com/discourse/discourse/commit/b1593c018440cad761f6fd527cb12508c205639b

As I didn’t want to refactor the whole discovery-categories file, do you think that should be enough @sam ?

6 Likes

Seems fine to me, very safe change.

6 Likes

This topic was automatically closed after 24 hours. New replies are no longer allowed.