Commit graph

56 commits

Author SHA1 Message Date
Hugh Rundle f011f2bce9
hide instance actor from users
The Instance Actor is required for signing http GET requests but is not a "user" and should not be otherwise interacted with.

- hides instance actor profile page, returning a 404
- excludes instance actor from search results and suggestions including in Getting Started
- replaces link to user profile in user admin page with a brief message box
- replaces panel in user admin page that allows for user to be suspended or removed with a message explaining why that is a very bad idea

fixes #3119
2023-11-20 12:17:52 +11:00
Hugh Rundle 5ed1441ddb
fix illegal values in redis jobs
1. populate_streams_get_audience

This tries to set status_reply_parent_privacy as None if there is no status.reply_parent, but None is not a valid value for privacy.
This doesn't appear to be  breaking anything but does result in a lot of error messages in the logs.
I have set this to equal the original status.privacy - this won't realy have any effect since it only happens when there is no parent,
however we could set this to "direct" if we want to be highly cautious.

2. rerank_user_task

Again, this doesn't seem to caused major issues, but is throwing errors if the user in question no longer exists for some reason.
This commit checks whether 'user' exists before attempting to rerank.
2023-08-19 08:34:03 +10:00
Wesley Aptekar-Cassels 3e78e398c0 Switch from priority queues to function-based queues
Fixes: #2907
2023-07-20 12:25:30 -04:00
Wesley Aptekar-Cassels 1048638e30 Stop ignoring task results
This is essentially a revert of 9cbff312a. The commit was at the advice
of the Celery docs for optimization, but I've since decided that the
downsides in terms of making things harder to debug (it makes Flower
nearly useless, for instance) are bigger than the upsides in performance
gain (which seem extremely small in practice, given how long our tasks
take, and the number of tasks we have).
2023-04-07 21:51:44 -04:00
Mouse Reeve 4e3513bd41
Merge pull request #2784 from WesleyAC/add-status-cache-get-audience
Only call get_audience once in add_status
2023-04-07 06:43:04 -07:00
Mouse Reeve 22dc4cbcb8
Merge pull request #2791 from WesleyAC/add-rerank-users-telemetry
Add telemetry for SuggestedUsers rerank_user_task
2023-04-07 06:29:44 -07:00
Wesley Aptekar-Cassels c89da1bd66 Don't include deleted users in suggested users query
Related: #2727
2023-04-07 04:18:36 -04:00
Wesley Aptekar-Cassels 4e09391b2e Add telemetry for SuggestedUsers rerank_user_task
Related: #2727
2023-04-06 12:22:39 -04:00
Wesley Aptekar-Cassels 78607a0c3e Remove get_stores_for_object abstract method
The implementations still have and use this, we've just removed this
concept from the RedisStore abstraction, which simplifies things
somewhat.
2023-04-05 22:07:38 -04:00
Wesley Aptekar-Cassels 68c6a9e748 Rename remove_object_from_related_stores
This makes the stores argument required, making it simpler to change the
code.
2023-04-05 22:06:09 -04:00
Wesley Aptekar-Cassels 8053f49acc Always pass stores to remove_object_from_related_stores 2023-04-05 21:48:24 -04:00
Wesley Aptekar-Cassels 9cbff312a5 Ignore Celery task results
Since we don't use the results of our Celery tasks (all of them return
None implicitly), it's prudent to set the ignore_result flag, for a
potential performance improvement. See the Celery docs for details [1].

We could do this with the global CELERY_IGNORE_RESULT setting, but it
offers more flexibility if we want to use task results in the future to
set it on a per-task basis.

[1]: https://docs.celeryq.dev/en/stable/userguide/tasks.html#ignore-results-you-don-t-want
2023-03-08 02:12:13 -05:00
André Jaenisch 530d7de309
Use variable instead of string
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-11-13 16:59:05 +01:00
Mouse Reeve 165fdc6d2d Merge branch 'main' into list-not-loading 2022-01-07 10:32:17 -08:00
Mouse Reeve deaa06d44c Sort suggestions by mutuals 2022-01-06 13:02:12 -08:00
Mouse Reeve 32ac4111aa
Merge pull request #1768 from bookwyrm-social/shelf-button-cache
Cache queries in feed view
2022-01-06 10:42:31 -08:00
Mouse Reeve 6168ce91b3
Merge branch 'main' into list-not-loading 2022-01-05 16:33:05 -08:00
Mouse Reeve 4a43ad95ef Linting on suggested_users 2022-01-05 13:51:34 -08:00
Mouse Reeve c28fbbeb09 Uses single query to get suggested users 2022-01-04 16:33:19 -08:00
Mouse Reeve 23e498879e Fixes account create tasks 2022-01-04 14:17:14 -08:00
Hugh Rundle e261bfdb6a fix local filter for suggested users 2021-10-16 08:20:12 +11:00
Mouse Reeve 73a8f89bee
Merge branch 'main' into bookwyrm-groups 2021-10-06 11:37:38 -07:00
Mouse Reeve f99a61b6bd Remove follow suggestion on request 2021-10-04 12:52:51 -07:00
Hugh Rundle 782512b2ce replace get_group_suggestions
- adds **filters argument to get_suggestions()
- passes local=True arg to get_suggestions() for group member suggestions
- removes get_group_suggestions()

Thanks to Mouse for the suggestion to keep the codebase DRY!
2021-10-04 21:25:38 +11:00
Hugh Rundle 29f18ee123 only suggest local users as potential group members 2021-10-02 19:35:57 +10:00
Mouse Reeve 377a4e1ef1 Updating string format syntax part 1 2021-09-17 21:39:18 -07:00
Mouse Reeve 4db5677509 Fixes filters 2021-09-08 12:06:23 -07:00
Mouse Reeve 88a65b0b88 Only re-rank on bookwyrm instances 2021-09-08 11:47:36 -07:00
Mouse Reeve d3b3dd6d99 Update suggestions on domain block 2021-09-08 11:38:22 -07:00
Mouse Reeve 2e2ee72333 Fixes inactive or mastodon users showing up in suggestions
They shouldn't be there, but just to be safe
2021-09-08 11:26:41 -07:00
Mouse Reeve e06e507c8d Cleans up suggested users logic 2021-09-08 11:14:41 -07:00
Mouse Reeve aa91361fe4 Fixes celery kwarg for queue 2021-09-07 17:09:44 -07:00
Mouse Reeve de3f18655c Set priorities on tasks 2021-09-07 16:33:43 -07:00
Mouse Reeve 9030f0d08b Bookwyrm user was already set 2021-08-06 09:14:07 -07:00
Mouse Reeve d126d7ba91 Disable comically inefficient book count comparisons
Oops! Hopefully I can restore these in a way that doesn't break at even
a moderate scale
2021-08-06 08:43:05 -07:00
Mouse Reeve 6db6aa6cb1 Fixes removing user from recs on follow 2021-08-04 09:49:05 -07:00
Mouse Reeve be044bce0d Updates mocks 2021-08-03 10:25:53 -07:00
Mouse Reeve ee7bdc956a Streamline saves on user create 2021-08-03 07:43:03 -07:00
Mouse Reeve df9787dd7a Removes stale data before doing repopulation
This probably is only an issue when there are very few users, like my
test instance
2021-08-02 18:14:44 -07:00
Mouse Reeve 5174260351 Python formatting 2021-05-22 15:57:08 -07:00
Mouse Reeve edfc27a3cd Moves suggestion logic to celery 2021-05-22 15:53:07 -07:00
Mouse Reeve 644e5926db Remove suggested users on block 2021-05-22 14:05:59 -07:00
Mouse Reeve 9250b8b85d Handle follow/unfollow 2021-05-22 13:02:37 -07:00
Mouse Reeve 42699a8d25 Update your own suggestions on shelve 2021-05-22 12:20:23 -07:00
Mouse Reeve f849d785a5 Functional un-discoverable setting 2021-05-22 12:10:14 -07:00
Mouse Reeve 29130d5f44 Detect new users and users with updated discoverability 2021-05-22 11:58:33 -07:00
Mouse Reeve 0044dc6587 Show suggested users when the feed is empty 2021-05-22 11:29:41 -07:00
Mouse Reeve f98576bc25 Only create suggestions stores for local users 2021-05-22 11:01:35 -07:00
Mouse Reeve 32b3a02a17 Fixes reverse rank calculation 2021-04-26 11:14:26 -07:00
Mouse Reeve 5b5da46ede Merge branch 'main' into suggestions-redis 2021-04-26 10:43:25 -07:00