discourse/app
Martin Brennan b2acc416e7
FIX: Server-side hashtag lookups of secure categories for a user (#19377)
* FIX: Use Category.secured(guardian) for hashtag datasource

Follow up to comments in #19219, changing the category
hashtag datasource to use Category.secured(guardian) instead
of Site.new(guardian).categories here since the latter does
more work for not much benefit, and the query time is the
same. Also eliminates some Hash -> Model back and forth
busywork. Add some more specs too.

* FIX: Server-side hashtag lookup cooking user loading

When we were using the PrettyText.options.currentUser
and parsing back and forth with JSON for the hashtag
lookups server-side, we had a bug where the user's
secure categories were not loaded since we never actually
loaded a User model from the database, only parsed it
from JSON.

This commit fixes the issue by instead using the
PretyText.options.userId and looking up the user directly
from the database when calling hashtag_lookup via the
PrettyText::Helpers code when cooking server-side. Added
the missing spec to check for this as well.
2022-12-09 10:34:25 +10:00
..
assets FIX: Server-side hashtag lookups of secure categories for a user (#19377) 2022-12-09 10:34:25 +10:00
controllers FEATURE: Allow category moderators to set auto deletion topic timers (#19383) 2022-12-08 17:14:43 -03:00
helpers FEATURE: Optionally allow a separate `s3_asset_cdn_url` to be specified (#19284) 2022-12-08 10:36:20 +00:00
jobs DEV: Migrate sidebar site settings (#19336) 2022-12-08 09:44:29 +08:00
mailers SECURITY: Filter tags in user notifications for visibility (#19239) 2022-11-29 10:35:41 -06:00
models FIX: Server-side hashtag lookups of secure categories for a user (#19377) 2022-12-09 10:34:25 +10:00
serializers FEATURE: Show similar users when penalizing a user (#19334) 2022-12-08 14:42:33 +02:00
services FIX: Server-side hashtag lookups of secure categories for a user (#19377) 2022-12-09 10:34:25 +10:00
views DEV: use structured data in topic-list for referencing only (#16235) 2022-12-05 18:00:32 +02:00