discourse/app/assets/javascripts/pretty-text
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
..
addon FEATURE: Enforce mention limits for chat messages (#19034) 2022-12-06 14:54:04 -03:00
app DEV: Move pretty-text into an ember-addon format (#9689) 2020-05-07 12:37:47 -04:00
config DEV: Upgrade to Ember 3.28 2022-07-19 10:00:59 +01:00
engines/discourse-markdown FIX: Server-side hashtag lookups of secure categories for a user (#19377) 2022-12-09 10:34:25 +10:00
tests DEV: Make addons buildable on their own (#17205) 2022-06-23 22:19:54 +02:00
vendor DEV: Ember Addon needs a vendor dir 2020-05-07 15:45:35 -04:00
.npmrc DEV: Prevent npm usage (#13945) 2021-08-04 22:04:58 +02:00
ember-cli-build.js DEV: Upgrade to Ember 3.28 2022-07-19 10:00:59 +01:00
index.js REFACTOR: Support bundling our `admin` section as an ember addon 2020-09-22 15:14:29 -04:00
jsconfig.json DEV: Add `discourse/tests` to jsconfig (#19031) 2022-11-15 11:33:56 +00:00
package.json Build(deps-dev): Bump @embroider/test-setup in /app/assets/javascripts (#19272) 2022-11-30 22:56:25 +01:00