Disabled Uncategorized category is shown in mobile browsers when unlogged

Unlogged visitors able to see and access disabled Uncategorized category (only in mobile browsers!):

You may ensure that it does not appear in desktop browsers.

3 Likes

That’s strange, we’re definitely inconsistent here. We don’t show the uncategorized section on desktop but do on mobile when disabled via site settings. Is this CSS related @awesomerobot, or is it a structure issue?

2 Likes

Every bug I see about uncategorized just makes me want to remove the settings and special magic uncategorized sauce from Discourse. This has been plaguing us for 5 years now.

9 Likes

Nah, it should be removed from the HTML entirely when disabled. Not sure why the logic would be different here in one mobile template when it seems to work everywhere else…

4 Likes

I spent some time debugging this… and it was way more fiddly than expected.

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

This line will be different from mobile and desktop, resulting in a false on mobile as is very rightly showing the name of the setting: “DESKTOP category page style”.

In the end this code is never using any Uncategorized related site setting. But this difference in style will in one case trigger this or not: https://github.com/discourse/discourse/blob/master/app/models/category_list.rb#L19
Which will then make displayable_topics blank in one case and not the other https://github.com/discourse/discourse/blob/master/app/models/category_list.rb#L136
Resulting some category being deleted on desktop and not on mobile.

So we could add some knowledge of allow uncategorized topics but the name seems misleading (is there another setting to use for this?) and then I don’t think we want to spend so much time on this as it’s kind of an edge case and not so bad, and still making us spend more time on “Uncategorized”.

@sam Maybe we could make it pr-welcome?

5 Likes

This only big thing I support at this moment is deleting that site settings and shipping with a CSS rule that hides the badge from pre-seeded uncategorized slug.

Then all we need to do to remove uncategorized is delete it which makes much more sense rather than the huge amount of uncategorized contortion we have today.

4 Likes

Not a bug.

If you “disable” uncategorized but have not assigned a category to all the previously uncategorized topics, then… well, this is as expected. Recategorize the “welcome to cuba forum” topic.

1 Like

Hi @codinghorror,
Thank you for your attention to this problem! My fault was leaving my topic uncategorized while I disabled uncatecorized topics at all. After recategorizing this category has disappeared, as expected. Anyway, that’s weird, when desktop browser does not show the stuff, but mobile browser does and only for unlogged users.