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).
AI-generated summary
The discussion revolves around a bug where Composer opens without a draft key, occurring sporadically on mobile devices, particularly iOS. Users 8BIT and david report the issue, with david providing a consistent reproduction method on mobile: navigating to the ‘Latest’ section and clicking ‘New Topic’. j.jaffeux identifies the root cause in the discovery-categories.js.es6 file, where mobile and desktop paths differ in how they handle draft keys. A fix is proposed by j.jaffeux, modifying the mobile path to ensure the draft key is set, and sam approves the change as safe and sufficient.
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.
i can’t seem to replicate it consistently enough, but, i do not think so…
This is your alert @sam any diagnostic ideas?
I’ve managed to reproduce this consistently on mobile
- Visit
https://meta.discourse.org/categories, refresh the page - Navigate to Latest
- Click New Topic
- Error occurs
Navigating to another page resolves the issue. Here’s a video of the process:
Marcando esto como Contribute > Bug con un pr-welcome ahora que tenemos una reproducción clara.
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.
So this is coming from here:
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 ?
Seems fine to me, very safe change.
This topic was automatically closed after 24 hours. New replies are no longer allowed.
