Commit graph

6642 commits

Author SHA1 Message Date
Mouse Reeve c6aaa80c62
Merge pull request #2947 from bookwyrm-social/small-ui-fixes
Small UI fixes
2023-08-19 15:09:12 -07:00
Mouse Reeve 1e0fe6d7c8 Remove duplicate if statement 2023-08-19 15:06:57 -07: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
Margaret Fero d7adada29c
Add Spanish Articles
Added articles for spanish language to list of articles in settings
2023-08-15 22:53:43 -07:00
Mouse Reeve 63b60ad62c Removes "all books" link from profile when there are none 2023-08-06 19:40:59 -07:00
Mouse Reeve 185486c6fc Uses {% empty %} instead of if statements 2023-08-06 19:35:50 -07:00
Mouse Reeve 53c8085207
Merge pull request #2946 from bookwyrm-social/followers-page-breadcrumbs
Adds breadcrumbs and better titles to followers/following pages
2023-08-06 19:13:35 -07:00
Mouse Reeve a05942fe15 Allow searching for local users when logged out 2023-08-06 18:23:57 -07:00
Mouse Reeve d9f6449767 Pre-populate sort title in edit book form if not provided
It's confusing to edit a book when this isn't set, so this provides the
best-guess version of the sort title if there isn't one provided, and
allows the user to change it as needed.
2023-08-06 17:57:57 -07:00
Mouse Reeve 15e82ece07
Merge pull request #2854 from bookwyrm-social/report-actions
Record report actions
2023-08-06 16:52:24 -07:00
Mouse Reeve 861d3b1500
Merge pull request #2935 from jderuiter/markdown-import
Convert description from Markdown when importing from Open Library
2023-08-06 16:14:25 -07:00
Mouse Reeve 518f87ef62 Adds merge migration 2023-08-06 16:02:28 -07:00
Mouse Reeve a166af9990
Merge branch 'main' into report-actions 2023-08-06 16:00:59 -07:00
Mouse Reeve e76b44fc8f
Merge pull request #2921 from axiomizer/isbn-hyphenation
Isbn hyphenation
2023-08-06 15:59:19 -07:00
Mouse Reeve b7e7867b9b
Merge pull request #2938 from jderuiter/redirect-referer
On readthrough, progressupdate or status delete return to previous page
2023-08-06 15:41:26 -07:00
Mouse Reeve e8949bbffd Make sure defaults are set on directory filters 2023-08-06 15:37:26 -07:00
Mouse Reeve 27c40ccf20 Uses comma formatting on user follower/following display values 2023-08-06 15:37:26 -07:00
Mouse Reeve 66250e0dd8 Consistent null states and page titles in user profile views 2023-08-06 15:36:56 -07:00
Mouse Reeve 0e43cc4274 Adds breadcrumbs and better titles to followers/following pages 2023-08-06 15:09:45 -07:00
Mouse Reeve 013c726869
Merge pull request #2918 from jderuiter/dutch
Include Dutch locale
2023-08-05 14:34:05 -07:00
axiomizer 83ad45644b Make hyphenated ISBN a property on the book model 2023-08-03 18:01:02 -04:00
Joeri de Ruiter 2dddb2e3da Revert change to redirect when deleting status 2023-08-03 13:18:35 +02:00
Joeri de Ruiter a901014e48 Change import of clean 2023-08-02 19:37:52 +02:00
Joeri de Ruiter ae5c27f3bb Sanitise description from Open Library 2023-08-02 19:30:40 +02:00
Joeri de Ruiter f4a4b59a14 Merge branch 'main' into markdown-import 2023-08-02 19:19:07 +02:00
Mouse Reeve 0be5cf31dc
Merge branch 'main' into isbn-hyphenation 2023-08-01 21:10:10 -07:00
Mouse Reeve 9d69f2fb3e
Merge pull request #2905 from bookwyrm-social/broken-editions
Adds management command to repair editions in bad state
2023-08-01 21:08:43 -07:00
Mouse Reeve 73f1484025
Merge pull request #2915 from axiomizer/main
Add copy button for ISBN
2023-08-01 20:55:12 -07:00
Mouse Reeve 455b0c82ea Fixes typo and outdated comment 2023-08-01 20:53:06 -07:00
Mouse Reeve acafa0b417
Merge pull request #2925 from jderuiter/mypy-connectors
Type annotations and related changes for connectors
2023-08-01 20:46:56 -07:00
axiomizer 3ca36fef4d Make copy button screen reader friendly
revert last commit because prettier was run with the wrong version
This reverts commit 5d3883c9a0.
2023-08-01 22:56:05 -04:00
Mouse Reeve 173d0b77ac
Merge pull request #2937 from jderuiter/create-book-fixes
Fixes for create-book
2023-08-01 19:02:33 -07:00
Mouse Reeve 211b60bba2
Merge pull request #2934 from bookwyrm-social/reduce-status-tasks
Only trigger add_status_task when status is first created
2023-08-01 08:30:43 -07:00
Joeri de Ruiter d1bad521e9 When deleting readthrough, progressupdate or status, return to referer instead of main page 2023-08-01 17:19:10 +02:00
axiomizer 8565367993 Fix pylint issues and failing unit tests 2023-08-01 09:45:13 -04:00
Joeri de Ruiter 220cad8661 Only show author confirmation if new authors are added, show suggestions for parent work and set it correctly. 2023-08-01 15:12:50 +02:00
axiomizer 5d3883c9a0 run prettier on bookwyrm.js 2023-08-01 08:09:10 -04:00
Joeri de Ruiter 1a733746f2 Only remove surrounding p tags if there are no other p tags 2023-08-01 12:17:57 +02:00
Joeri de Ruiter 1a215e9b9e Convert description from Markdown to HTML when importing from Open Library 2023-08-01 11:45:46 +02:00
Mouse Reeve 3336fd0f11 Updates test 2023-07-31 17:48:09 -07:00
Mouse Reeve f6fba19ac4 Only trigger add_status_task when status is first created
I think the reason I didn't do this initially was so that related users
and books, which are added necessarily after the model instance is
crated, will be part of the object when the task runs, but I have
investigated this and because of the transaction.atomic statement in the
to_model method in bookwyrm/activitypub/base_activity.py and in the
status view (added in this commit), this is not an issue.
2023-07-31 17:23:57 -07:00
Joachim 928d56b566 Fix function docstring 2023-07-31 22:15:09 +02:00
Joachim e37ed8ea5e Remove links trailing punctuation 2023-07-31 22:12:37 +02:00
Hugh Rundle 390f61ff3b
Merge branch 'main' into wip-edit-post-and-save 2023-07-31 16:25:04 +10:00
Hugh Rundle 61283b3d4f
Merge pull request #2929 from joachimesque/search-disable-spellcheck
Disable Spellcheck on header search inputs
2023-07-31 14:42:30 +10:00
Joachim 6a81f91902 Disable Spellcheck on header search inputs 2023-07-30 22:33:08 +02:00
Mouse Reeve 71dc05f894 Reduce activity in streams queue from boost tasks 2023-07-30 13:07:12 -07:00
Joeri de Ruiter 2920973961 Some small improvements to annotations 2023-07-28 20:54:03 +02:00
Joeri de Ruiter f07d7b02f1 Type annotations and related changes for bookwyrm.connectors 2023-07-28 17:43:32 +02:00
Joeri de Ruiter 8736f2c6ef Remove '@' from the beginning of hashtag names in activity 2023-07-28 11:20:08 +02:00
Tara Sophia Roshan c721e17aa0 Change wording from 'Save' to 'Update'
I think this wording is more clear.
2023-07-27 17:45:06 -05:00
Tara Sophia Roshan 9cd599dee3 Indicate edited post is saved
Should close #2642 and #2671. Gives a minimal solution to #2668.
2023-07-27 00:22:12 -05:00
axiomizer 2293c1c5a8 Revert part of "Hyphenate ISBN numbers and add copy button" related to copy button
This partially reverts commit d2c4785af1.
2023-07-25 08:54:49 -04:00
axiomizer bd26da351a Hyphenate ISBN numbers and add copy button 2023-07-25 08:54:49 -04:00
Joeri de Ruiter fec6f39e4e Migration to include Dutch in user.preferred_language 2023-07-23 21:34:28 +02:00
Joeri de Ruiter 308dfd1be0 Include Dutch locale 2023-07-23 21:27:42 +02:00
Joeri de Ruiter 0354e53eea Type annotations for utils 2023-07-23 20:50:44 +02:00
axiomizer 9a30a3656a satisfy js linter 2023-07-22 22:34:10 -04:00
axiomizer 1bda8a5d9d Revert part of "Hyphenate ISBN numbers and add copy button" related to hyphenation
This partially reverts commit d2c4785af1.
2023-07-22 14:25:58 -04:00
Joeri de Ruiter 75f37d7361 Added mypy to scripts and workflow, and some first annotations for celerywyrm 2023-07-22 13:27:43 +02:00
axiomizer d2c4785af1 Hyphenate ISBN numbers and add copy button 2023-07-21 21:27:46 -04:00
Mouse Reeve eae06602a9 Fixes test data 2023-07-21 14:38:28 -07:00
Mouse Reeve 9c5b5d0ac1 Updates version 2023-07-20 19:08:47 -07:00
Mouse Reeve c4d72829e9
Merge pull request #2879 from bookwyrm-social/reactivation-bug
Don't allow invalid account reactivation
2023-07-20 19:07:18 -07:00
Mouse Reeve c947360da8
Merge pull request #2910 from WesleyAC/no-unauthed-remote-profile-view
Don't show remote profiles to unauthenticated users
2023-07-20 19:06:50 -07:00
Wesley Aptekar-Cassels aae1d10eea Don't show remote profiles to unauthenticated users 2023-07-20 20:29:08 -04:00
Wesley Aptekar-Cassels 3e78e398c0 Switch from priority queues to function-based queues
Fixes: #2907
2023-07-20 12:25:30 -04:00
Mouse Reeve ccf3a4c5c1 Skip trying to match editions
It's rare that it will be useful, and it was a huge hassle.
2023-07-18 19:33:39 -07:00
Mouse Reeve 8b88de624d Adds test and fixes logic errors 2023-07-17 20:00:45 -07:00
Mouse Reeve eee4e30e25 Adds managment command to repair editions in bad state 2023-07-17 11:22:59 -07:00
Mouse Reeve fbb9d75cc8 Avoid server error when encountering broken edition
If an edition is missing its work, this change allows the page to still
load without a server error; this is important because otherwise the
book will break every page it appears on, including the feed page.
2023-07-17 07:07:01 -07:00
Mouse Reeve 107f5b38ca
Merge pull request #2904 from bookwyrm-social/updating-pluralization-error
Fixes plural display on import admin page
2023-07-17 06:40:15 -07:00
Mouse Reeve ac4276f212
Merge pull request #2834 from zachflanders/2678
Add support for title sort to ignore initial article
2023-07-17 06:04:25 -07:00
Mouse Reeve 6778046906 Formats large numbers 2023-07-17 05:53:23 -07:00
Mouse Reeve fbb6c41035 Joins entire sentence in import pluralization string 2023-07-17 05:49:40 -07:00
Mouse Reeve 815e788245
Merge pull request #2631 from rritik772/pluralization-error
fixed singularisation/pluralisation
2023-07-17 05:46:34 -07:00
Mouse Reeve 3bd20e3ff8
Set batch size to 1,000
Updated as per the comments on the PR so this is ready to merge
2023-07-17 05:42:17 -07:00
Mouse Reeve 0818d5aabb
Merge branch 'main' into report-actions 2023-07-16 07:13:42 -07:00
Mouse Reeve 0832a2fa8e
Merge branch 'main' into reactivation-bug 2023-07-16 07:13:34 -07:00
Mouse Reeve d56b9f14a2 Handles changing user perms from report 2023-07-16 06:36:32 -07:00
Mouse Reeve 040dca0c31 Places first item of report history at top 2023-07-16 06:11:26 -07:00
Mouse Reeve a7e6919b96 Fixes confirm email slow and adds test 2023-07-16 05:55:38 -07:00
Hugh Rundle 1841d196ff
Ensure report button triggers modal
Clicking on "report" in any context closed the dropdown menu and required a second click on the dropdown to trigger the modal.
With this change, the modal opens as expected.

Reverses part of #2322
2023-06-26 12:22:14 +10:00
Mouse Reeve 6a949c24e2 Typo fix 2023-06-21 15:52:32 -07:00
Mouse Reeve 11f1a4662e Don't allow invalid account reactivation 2023-06-21 15:47:20 -07:00
Mouse Reeve 4f6a235d77 Reverses order of report action list 2023-06-21 15:05:02 -07:00
Jascha Ezra Urbach a601be4708
Merge branch 'main' into 2678 2023-06-01 16:53:28 +02:00
Mouse Reeve 65e3a31354
Merge pull request #2864 from bookwyrm-social/locales
Update locales
2023-05-30 11:37:01 -07:00
Mouse Reeve c6d23ba26a Record statuses deleted in reports 2023-05-30 11:35:47 -07:00
Mouse Reeve 0bb0537215 Updates version number 2023-05-30 11:00:12 -07:00
Mouse Reeve ca3054fdac
Merge pull request #2827 from hughrun/2571
Retain subjects and authors when new book form fails validation
2023-05-30 10:51:52 -07:00
Mouse Reeve 9056a5d9e7
Merge pull request #2842 from bookwyrm-social/set-remote-server
Set remote servers synchonously where possible
2023-05-30 10:51:39 -07:00
Mouse Reeve d251f4201b
Merge pull request #2857 from bpeel/no-rating
Show “no rating” instead of blank stars if the review has no rating
2023-05-30 10:42:09 -07:00
Mouse Reeve aec99ba173
Merge pull request #2862 from kvibber/rssdate
Add dates to RSS feeds and sort by most recent first
2023-05-30 10:36:01 -07:00
Mouse Reeve a4ccd45537
Merge pull request #2812 from hughrun/gts
Fix federation with GoToSocial and inconsistent KeyId in headers
2023-05-29 19:54:00 -07:00
Kelson Vibber 70679856bd apply linter 2023-05-28 22:42:37 -07:00
Kelson Vibber c21d580fd8 sort feed by most recent 2023-05-28 22:38:53 -07:00
Kelson Vibber 98f5cd9393 apply linting 2023-05-28 22:25:01 -07:00
Kelson Vibber 637e0376d4 rss dates 2023-05-28 21:55:26 -07:00
Neil Roberts 603b2d9502 Show “no rating” instead of stars if the review has no rating
The stars.html template now outputs a span containing “no rating” when
the stars represent a non-existent or zero rating. This text is already
translated because it was previously added as a invisible text only for
screen readers. The span is given a special CSS class so that it can be
styled as italic in the stylesheet.

There is now also an extra span in book.html to group the stars with the
“(2 reviews)” text. This is needed because the outer div is using a flex
layout and it eats the spacing between the two parts otherwise.

Fixes #2856
2023-05-22 15:40:18 +02:00
Mouse Reeve affaf3d0ba Fixes tests and incorrect class method reference 2023-05-22 06:39:23 -07:00
Mouse Reeve b3a519c082 Converts report "comments" into broader "actions" table
This table will now track all actions taken on a report, like resolving
it, re-opening it, suspending the reported user, et cetera, in addition
to comments. When there are multiple admins, this change will make it
easier to understand what actions have been taken by whom on a report.
2023-05-16 11:00:33 -07:00
Mouse Reeve ab146f652a Adds action types to report comments table 2023-05-16 09:02:43 -07:00
Mouse Reeve 24d59315df
Merge pull request #2843 from bookwyrm-social/user-reports-link
Show all (not just open) reports when linked from user admin
2023-05-15 06:04:42 -07:00
Mouse Reeve d6a321dda9
Merge pull request #2839 from WesleyAC/optimize-get-audience-user-id-only
Optimize get_audience by only fetching IDs
2023-05-15 06:03:40 -07:00
Mouse Reeve 120a0f1882
Merge pull request #2852 from bpeel/remove-from-translate-shelf-name
Use the translated shelf name in the “remove from” shelf button
2023-05-15 05:43:13 -07:00
Mouse Reeve 0e0d9d2d08 Updates ignore html error list 2023-05-15 05:31:07 -07:00
Neil Roberts 666f09c576 Use the translated shelf name in the “remove from” shelf button
The button to remove a book from a shelf when looking at the book’s page
wasn’t using the translated shelf name. It was also concatenating
strings instead of using a placeholder, which is difficult to translate
in some languages. This fixes it to use the translate_shelf_name
function and use the same placeholder string as in other places.
2023-05-15 11:26:12 +02:00
Neil Roberts a4ea4082e6 Use the translated shelf name in message when another edition is shelved
In the page for an edition, if the user has a different edition of the
same work on a shelf then a message is shown. Previously the name of the
status shelves wasn’t being translated.
2023-05-12 15:33:51 +02:00
Mouse Reeve 379db26300 Fixes user model tests for new param 2023-05-07 10:01:33 -07:00
Mouse Reeve 912e92bacd Show all (not just open) reports when linked from user admin 2023-05-07 09:50:24 -07:00
Mouse Reeve bfb29c0d74 Set remote servers synchonously where possible 2023-05-07 09:24:45 -07:00
Zach Flanders ad1ddf2bff Fixing batch size 2023-04-29 09:48:01 -05:00
Zach Flanders 490064cdf8 updating sort title migration 2023-04-29 09:43:55 -05:00
Hugh Rundle 5c9b962639 retain additional authors on form failure when editing book 2023-04-29 09:42:57 +10:00
Wesley Aptekar-Cassels 097cd3ed72 Optimize get_audience by only fetching IDs
Looking at the tracing data from this function in prod, only ~500ms is
spent in the database. My best guess for the rest of the time is
transferring and creating the user objects, which we don't use, since we
simply need the ID.
2023-04-28 12:51:44 -04:00
Zach Flanders a1df116c58 Adding batch processing to the sort title migration 2023-04-27 15:30:52 -05:00
Zach Flanders a6e5939ad2 adding sort title to edit book form 2023-04-26 23:05:03 -05:00
Neil Roberts d80cefd416 Add a management command to merge works 2023-04-26 15:54:37 +02:00
Zach Flanders 3f205f1b10 Merge branch '2678' of https://github.com/zachflanders/bookwyrm into 2678 2023-04-25 21:06:13 -05:00
Zach Flanders 858a93e98a fixing migration 2023-04-25 21:05:11 -05:00
Zach Flanders f43d7f8c70 fixing test and other checks 2023-04-25 21:00:16 -05:00
Mouse Reeve 7bd9623b68
Revert "Increase Celery ping timeout for monitoring page" 2023-04-25 18:24:23 -07:00
Zach Flanders 1985c2d284
Merge branch 'main' into 2678 2023-04-25 19:47:07 -05:00
Zach Flanders 575e1bac4c responding to review comments 2023-04-25 19:46:38 -05:00
Mouse Reeve b77ae9e783 Ticks version number 2023-04-25 17:42:32 -07:00
Mouse Reeve 8fa89f5ece
Merge pull request #2821 from bpeel/merge-commands
Add management commands to merge a pair of editions or authors
2023-04-25 16:27:12 -07:00
Mouse Reeve ac48457748
Merge pull request #2770 from bookwyrm-social/import-rating-parser
Catch value errors when parsing imported ratings
2023-04-25 16:21:25 -07:00
Mouse Reeve cbb027c56c
Merge pull request #2778 from ranok/upstream_pr
Move the search request logic into the AbstractConnector
2023-04-25 16:20:24 -07:00
Zach Flanders 6b39052fcc Adding test for sort_title population 2023-04-25 07:17:23 -05:00
Zach Flanders a3013c6224 updating list view 2023-04-25 00:20:54 -05:00
Zach Flanders 21d9cb5fe5 updating shelf view 2023-04-25 00:15:58 -05:00
Zach Flanders a94a4732ec add support for title sort to ignore initial article 2023-04-24 23:29:55 -05:00
Mouse Reeve 718939834a Fixes check on isbn list length in LT importer 2023-04-18 10:04:20 -07:00
Jacob Torrey 84834eb5d3 Run bw-dev black to fix formatting
Signed-off-by: Jacob Torrey <jacob@jacobtorrey.com>
2023-04-17 15:06:41 +00:00
Jascha Urbach 0cae89b2b6
Update wellknown.py
./bw-dev black
2023-04-16 17:30:27 +02:00
Jascha Urbach f3b1b1d8e4
Fix language constant to show correct lang in API
api/v1/instance had "en" hardcoded as language. This fix takes LANGUAGE_CODE from settings.py/.env and takes the first two letters as response.
2023-04-16 17:28:05 +02:00
Hugh Rundle 5f5886edea Actually fix ensure_transient_values_persist call
oops
2023-04-16 19:58:53 +10:00
Hugh Rundle 6f025af99f fix ensure_transient_values_persist call 2023-04-16 19:06:04 +10:00
Hugh Rundle 74f08323d1
Merge branch 'main' into 2571 2023-04-16 18:11:39 +10:00
Hugh Rundle fb3cb229e9 Fixes #2571
Persist book.subjects and add_author when form validation fails.

This does not resolve the problem of cover image uploads being dropped because this is a broader problem and is covered separately in #2760
(we should investigate the plugin ` django-file-resubmit`)
2023-04-16 17:58:03 +10:00
Mouse Reeve 290b740392
Merge pull request #2805 from WesleyAC/stop-ignoring-task-results
Stop ignoring task results
2023-04-15 09:03:43 -07:00
Jascha Ezra Urbach c918617a6a
Merge branch 'main' into import-rating-parser 2023-04-15 17:21:27 +02:00
Jascha Ezra Urbach fadbc76aaa
Merge pull request #2789 from bpeel/translatable-shelf-name
Fix two places where the reading status shelf name wasn’t translated
2023-04-15 16:59:59 +02:00
Jascha Urbach e28562949b
./bw.-dev black
get rid of the black error.
2023-04-15 16:31:15 +02:00
Neil Roberts bd893e29de Add management commands to merge editions and authors 2023-04-15 11:59:40 +02:00
Neil Roberts 71e2486d01 Move the merging code from deduplicate code to common module
That way it can be used in a new command to merge individual items.
2023-04-15 11:59:40 +02:00
Neil Roberts 2bbc9a16ad Fix deduplicating books that are on a shelf or in a list
Previously when the deduplicate_book_data script tried to merge an
edition that was on a shelf or in a list then it would fail because when
the canonical book was added to the shelf or the list then it wouldn’t
set the extra fields of the linking table for the “through” model of the
field. These would end up defaulting to NULL, but that is not valid for
some of the fields in ShelfItem and ListItem so postgres wouldn’t accept
it.

To fix that, this patch makes it skip updating fields that have a
non-autogenerated linking table. The linking table would appear as a
separate model anyway so the book will be moved via that instead.

Fixes: #2817
2023-04-15 11:59:12 +02:00
Neil Roberts 3619d8960b Mark two strings as translatable in the getting started questionnaire 2023-04-14 16:49:00 +02:00
Neil Roberts f520d1b7f8 Make the text on the search button translatable 2023-04-14 16:40:50 +02:00
Hugh Rundle a0b7112c9c
Merge branch 'main' into gts 2023-04-14 18:24:02 +10:00
Hugh Rundle 98726585f6 oops black 2023-04-14 18:20:06 +10:00
Hugh Rundle 8a8af4e909 fix tests and make pylint happier 2023-04-14 18:03:51 +10:00
Hugh Rundle 123628c66a fix tests and formatting 2023-04-13 22:33:54 +10:00
Hugh Rundle 56a062d01f pylint fixes 2023-04-13 20:21:35 +10:00
Hugh Rundle c7adb62831 make get_legacy_key more DRY 2023-04-13 19:48:20 +10:00
Hugh Rundle a6676718cb formatting 2023-04-13 13:27:51 +10:00
Hugh Rundle e3261c6b88 fix incoming GTS mentions and DMs
GoToSocial sends 'tag' values as a single object if there is only one
user mentioned, rather than an array with an object inside it.

This causes Bookwyrm to reject the tag since it comes through as a
dict rather than a list.

This commit fixes this at the point the incoming AP object is transformed
so that "mention" tags are turned into a mention_user.
2023-04-13 13:21:05 +10:00
Wesley Aptekar-Cassels 8e25ae34d6
Merge pull request #2782 from ranok/list_fix
Small quality of life improvements to list handling
2023-04-11 12:31:58 -04:00
Wesley Aptekar-Cassels 843147e16b
Merge pull request #2808 from bpeel/series-no-author
Don't show the series as a link if the book has no author
2023-04-11 12:25:52 -04:00
Hugh Rundle c450947eee update comment to identify bug 2023-04-11 18:57:55 +10:00
Hugh Rundle 279fa3851b add comment 2023-04-11 16:49:11 +10:00
Hugh Rundle 03f21b0f35 Use correct keyId with legacy fallback
Bookwyrm keyIds are at `userpath/#main-key`, however when signing AP objects we have claimed in the headers that the keyId is at `userpath#main-key`.
This is incorrect, and makes GoToSocial's strict checking break.
Simply updating the signatures to use the correct KeyId breaks legacy Bookwyrm's signature checks, becuase it assumes that the keyId path is the same as the user path plus a fragment.
This commit allows for either option, by sending the request a second time with the incorrect keyId if sending with the correct one causes an error.
2023-04-11 15:45:06 +10:00
Hugh Rundle c9dcd4f7ad Include initial '@' in mention tag name
GoToSocial expects the 'name' value of a mention tag to have an initial '@' symbol. Mastodon doesn't seem to mind either way.
2023-04-10 20:38:20 +10:00
Hugh Rundle ef85394a16 Allow for tag value to be object
Previously the 'tag' value in an activitypub object was assumed to be a List (array).
Some AP software sends 'tag' as a Dict (object) if there is only a single tag value.
It's somewhat debatable whether this is spec compliant but we should aim to be robust.
This commit puts an individual mention tag inside a list if necessary.
2023-04-10 20:35:13 +10:00
Hugh Rundle e112718d2d clean up troubleshooting comment 2023-04-10 20:34:45 +10:00
Hugh Rundle 49758f2383 formatting fixes 2023-04-10 17:50:25 +10:00
Hugh Rundle 632e3844b9 Don't assume user id is key id minus fragment
Fixes #2801
Related to #2794

It is legitimate to use any url for the user's key id. We have been assuming this id is the user id plus a fragment (#key-id) but this is not always the case, notably in the case of GoToSocial it is at /key-id. This commit instead checks the remote user's information to see if the key id listed matches the key id of the message allegedly received from them.

Whilst troubleshooting this it also became apparent that there is a mismatch between Bookwyrm users' keyId and the KeyId we claim to be using in signed requests (there is a forward slash missing). Since everything after the slash is a fragment, this usually slips through but we should be consistent so I updated that.
2023-04-10 17:32:49 +10:00
Neil Roberts 41633090ba Don't show the series as a link if the book has no author
The series link needs an author so if it doesn't have one, instead of
showing a server error let's just show the series details as plain text
without a link.

Fixes: #2797
2023-04-08 17:13:34 +02:00
Wesley Aptekar-Cassels e9f26b7d50
Merge pull request #2800 from WesleyAC/fix-activitypub-request-accept-header
Fix Accept header for requesting ActivityPub objects
2023-04-08 11:02:27 -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
Wesley Aptekar-Cassels 07b50a1453 Optimize get_audience
This avoids filtering for the user that made the post in the same query
as we use for other things, which should allow for better use of indices
in all cases. Previously, #2723 did some work on this that only worked
for some cases in HomeStream, but this code should work for all cases.

Related: #2720
2023-04-07 10:38:14 -04:00
Wesley Aptekar-Cassels 77264493eb Override get_audience instead of _get_audience in LocalStream
I suspect this will make some future work simpler.
2023-04-07 10:37:02 -04:00
Mouse Reeve 5272786fbb
Merge pull request #2779 from WesleyAC/get_audience_more_telemetry
Add more information to get_audience telemetry
2023-04-07 07:12:41 -07: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 035ca6fec2
Merge pull request #2795 from WesleyAC/add-postgres-instrumentation
Add automatic instrumentation to Postgres queries
2023-04-07 06:39:47 -07:00
Mouse Reeve 10f53d9809
Merge branch 'main' into get_audience_more_telemetry 2023-04-07 06:30:59 -07:00
Mouse Reeve d033848d3f
Merge pull request #2780 from jsoref/spelling
Spelling
2023-04-07 06:30:16 -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
Mouse Reeve 5bcd294f47
Merge pull request #2793 from WesleyAC/ignore-activity-allow-external-connections
Pass allow_external_connections through ignore_activity
2023-04-07 06:23:26 -07:00
Mouse Reeve 5895524a25
Merge pull request #2787 from WesleyAC/celery-clear-queues-form
Add form to remove tasks from Celery
2023-04-07 06:17:50 -07:00
Mouse Reeve d11bb17698
Merge pull request #2798 from WesleyAC/celery-increase-ping-timeout
Increase Celery ping timeout for monitoring page
2023-04-07 06:13:07 -07:00
Mouse Reeve 206698238d
Merge pull request #2799 from WesleyAC/suggested-users-check-is-active
Don't include deleted users in suggested users query
2023-04-07 06:12:38 -07:00
Mouse Reeve a8235fc3a2
Moves the stray "e" back to "mobile" 2023-04-07 06:04:47 -07:00
Wesley Aptekar-Cassels 912d0a0149 Fix Accept header for requesting ActivityPub objects
This is the header described in the ActivityPub spec, which should fix
some federation problems with GoToSocial and potentially other picky
services.

Related: #2794, superseriousbusiness/gotosocial#1676
2023-04-07 05:57:13 -04: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 3709f5c7a9 Increase Celery ping timeout for monitoring page
This should prevent some transient alerts.
2023-04-07 03:18:43 -04:00
Wesley Aptekar-Cassels 6986fc9025 Add form to remove tasks from Celery 2023-04-07 03:16:14 -04:00
Wesley Aptekar-Cassels 61453d48e6 Add automatic instrumentation to Postgres queries
This enables automatic instrumentation of Postgres queries when
OpenTelemetry instrumentation is enabled, which will help with debugging
performance problems.
2023-04-07 01:58:49 -04:00
Wesley Aptekar-Cassels b574a12fff Pass allow_external_connections through ignore_activity
Previously, ignore_activity could unexpectedly make a outgoing HTTP
connection, leading to unwanted latency, particularly when called via
ActivityObject.to_model, which had the allow_external_connections
parameter already.

Related: #2717
2023-04-06 23:37:49 -04:00
Wesley Aptekar-Cassels 4e09391b2e Add telemetry for SuggestedUsers rerank_user_task
Related: #2727
2023-04-06 12:22:39 -04:00
Neil Roberts 9092c9c80c Add a translatable name for the "stopped-reading" status shelf 2023-04-06 16:03:35 +02:00
Neil Roberts b0f90d05f2 Move the shelf names to a dict instead of a chain of if statements
The main reason to do this is that if we try to add another name then
pylint will complain that there are too many return statements. It might
be slightly faster too.

If I understand correctly it doesn’t matter that the _ function is being
called at module load time because it is mapped to gettext_lazy so the
actual translation will be done when the string is used.
2023-04-06 16:02:24 +02:00
Neil Roberts 36c14655ec Use the translated shelf name in a book’s shelf list
Previously in the list of shelves on the page for a book it was always
using the English name of the shelf for the shelf of the reading status.
2023-04-06 15:58:20 +02:00
Wesley Aptekar-Cassels f91fcd518a Increase network timeout in Celery tasks
Since Celery tasks don't affect interactive latency, we should have a
more generous timeout. This also allows admins to set the timeout for
Celery and the web frontend separately, without breaking backwards
compatibility with the previous environment variable.
2023-04-06 01:21:27 -04:00
Wesley Aptekar-Cassels 776c5526c8 Remove ActivityStream.get_stores_for_object
I think this makes the code somewhat more understandable.
2023-04-05 23:20:47 -04:00
Wesley Aptekar-Cassels 7a93b5c315 Only call get_audience once in add_status
This is by far the most expensive part of this task, so this should
double the speed in the increment_unread case.

Related: #2720
2023-04-05 22:11:49 -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 93bd66ad3e Refactor to delete add_object_to_related_stores
This is working towards some optimizations.
2023-04-05 21:48:22 -04:00
Wesley Aptekar-Cassels 9c54030b61 Add add_object_to_stores function
This should enable some useful refactoring to allow us to cache some
results of expensive queries better.
2023-04-05 21:44:59 -04:00
Jacob Torrey 011844b7ac Small quality of life improvements to list handling
Signed-off-by: Jacob Torrey <jacob@jacobtorrey.com>
2023-04-05 16:17:28 +00:00
Josh Soref 359228127d spelling: wyrm
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref ba7f0fce71 spelling: whenever
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 2a914f98b7 spelling: versions
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref dfae27ca32 spelling: updated
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 459b74294d spelling: uniqueness
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 7170e8972d spelling: uneventfully
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 2d4a42ceba spelling: suggestions
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 63dbb6a291 spelling: successfully
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref ffd035f25a spelling: stores
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 9dc3cdca5d spelling: statuses
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref e4677eb6fa spelling: someone
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 4607d30cad spelling: signatures
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 18fcea35da spelling: should
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 35f1d043f4 spelling: separate
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 7a6e249614 spelling: sensitivity
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 02bf018271 spelling: search
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 2fb771f0de spelling: sanitize
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 4c9408d772 spelling: revoke
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref e5663f97c5 spelling: remove
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 182a722a55 spelling: recurring
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref e7d8692836 spelling: receiving
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 0b14d3fddf spelling: receive
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 55b6d63774 spelling: quotation
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 3526d9fd19 spelling: progress
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 764bc0c204 spelling: produce
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 27f025bc39 spelling: presence
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 1fdf5a7a39 spelling: physical
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 44b4b10eb8 spelling: password
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 9cddea11c7 spelling: paginate
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 7b59f38cc8 spelling: owner
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref c009f6e4df spelling: overridden
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 56f38c178c spelling: ordered
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref d9a305a0f2 spelling: optimizequality
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref d640bc9b1c spelling: nonexistent
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 40632b2486 spelling: multiple
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 0b30373bd3 spelling: mention'd
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref c216937dc4 spelling: massively
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 1320108703 spelling: markdown
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref e8894b159f spelling: irrelevant
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 649c782782 spelling: inheritance
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref d2d087dcb7 spelling: identifiername
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 7ec56505ea spelling: having a
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref cee2de41ca spelling: handling
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 7f8279fe54 spelling: format
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 802a150c76 spelling: flex
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 9c5d588630 spelling: fields
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref 050cd583df spelling: expiration
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00