Category overview - topics without permission are hidden, not replaced

AI-generated summary

A discussion is underway about the behavior of category pages when a user lacks permission to view certain sub-categories. AstonJ points out that the main category page shows a blank space where the latest topics should appear, even if those topics are in a private sub-category.

Codinghorror responds that this behavior is correct, as the user lacks permission to view those topics. However, AstonJ and Mittineague argue that the user should still be able to see the latest topics that are relevant to them.

SAM suggests that this issue may be related to caching, but Codinghorror and neil clarify that category page cache is no longer built for anonymous users and that a fix is possible. neil ultimately confirms that the bug has been fixed in time for version 1.4.

If a user can’t view a sub-category and the latest topics are in the sub-category, the main category shows a blank space where the topics should appear.

(The latest topics in the Ruby Chat section are in a private category - so everyone else sees a blank space as above.)

「いいね!」 1

Er, yes and..? This is correct, the anon user can’t see topics they do not hold permissions to view.

But the user looking at the page doesn’t care about that - he just wants to see the latest topics that are relevant to him.

Those topics are not relevant to him because he has no permissions to view them or know they exist.

He’s not interested in seeing those topics - just the ones that are relevant to him.

My take is AstonJ would like something like

Cat - user has perms
Subcat - user does not have perms
Subcat has 3 (or more) newer posts than the Cat does
Instead of showing the user blank, show the recent posts from the Cat

Likely to need some fancy coding to do, but might be possible I guess

「いいね!」 3

I suspect this may be a caching thing,

EG: category A is visible B invisible … and cache is only built for anon, so a person who has visibility into sub category does not get to see the topics in categories view.

This feels to me like a bug, so recategorizing.

「いいね!」 3

Category page cache is no longer built for anon as it reflects pin state, per recent @neil changes.

It was always being built from an admin’s perspective, even before my changes.

I think I can fix that for anons by adding 3 (or category_featured_topics setting) topics that anons can see to the end of the cache. If all others are filtered because of security, at least those will show.

「いいね!」 3

This bug has been fixed in time for 1.4.

:boot:
:bug:

「いいね!」 5