discourse/spec
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
..
fabricators PERF: stop downloading images from post processor and lean on uploads 2022-11-25 12:40:31 +11:00
fixtures FEATURE: Youtube Short onebox support (#19335) 2022-12-06 11:56:48 -03:00
helpers FEATURE: Optionally allow a separate s3_asset_cdn_url to be specified (#19284) 2022-12-08 10:36:20 +00:00
import_export DEV: Add a rake task to export/import translation overrides (#18487) 2022-10-05 15:22:16 -04:00
initializers Add RSpec 4 compatibility (#17652) 2022-07-28 10:27:38 +08:00
integration FEATURE: Track API and user API requests (#19186) 2022-11-29 13:07:42 +02:00
integrity DEV: Use proper wording for contexts in specs 2022-08-04 11:05:02 +02:00
jobs DEV: Migrate sidebar site settings (#19336) 2022-12-08 09:44:29 +08:00
lib FIX: Server-side hashtag lookups of secure categories for a user (#19377) 2022-12-09 10:34:25 +10:00
mailers SECURITY: Filter tags in user notifications for visibility (#19239) 2022-11-29 10:35:41 -06:00
models DEV: Migrate sidebar site settings (#19336) 2022-12-08 09:44:29 +08:00
multisite DEV: Fix mocha deprecations (#18828) 2022-11-02 10:47:59 +01:00
requests FEATURE: Allow category moderators to set auto deletion topic timers (#19383) 2022-12-08 17:14:43 -03:00
script/import_scripts DEV: Remove remaining hardcoded ids (#18735) 2022-10-25 15:29:09 +08:00
serializers DEV: Migrate sidebar site settings (#19336) 2022-12-08 09:44:29 +08:00
services FIX: Server-side hashtag lookups of secure categories for a user (#19377) 2022-12-09 10:34:25 +10:00
support DEV: introduces pause_test system tests helper (#19378) 2022-12-08 20:03:18 +08:00
system FEATURE: Allow showing hashtag autocomplete results without term (#19219) 2022-12-08 13:47:59 +10:00
tasks FIX: Allow attr updates of over-size-limit uploads (#18986) 2022-11-11 17:56:11 +01:00
views DEV: use structured data in topic-list for referencing only (#16235) 2022-12-05 18:00:32 +02:00
rails_helper.rb FEATURE: Generic hashtag autocomplete lookup and markdown cooking (#18937) 2022-11-21 08:37:06 +10:00
regenerate_swagger_docs DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
swagger_helper.rb DEV: Update rubocop (#18754) 2022-10-26 09:05:15 +08:00