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
Josh Soref
3b9828c0fc
spelling: existing
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
445cb60f2c
spelling: example
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
b949259c57
spelling: embedded
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
3850183e95
spelling: doesn't
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
8d4b69927b
spelling: directly
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
f6a6cb281b
spelling: different
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
45a1457a4f
spelling: deduplications
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
9cad11b2b3
spelling: deduplication
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
c2022acf67
spelling: deduplicate
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
9ea5a3b89c
spelling: data
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
cfe388896b
spelling: dashboard
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
6b0e51caf4
spelling: currently
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
be31a4b576
spelling: creating
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
72c292d2c3
spelling: breakpoints
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
fb74c1977e
spelling: because
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
54285e4bcd
spelling: auxiliary
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
b3edeca295
spelling: associated
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
319be60c80
spelling: assigning
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
06fa1adc27
spelling: arbitrary
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Josh Soref
94c573b469
spelling: appear
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:47 -04:00
Wesley Aptekar-Cassels
118b5bfda7
Add more information to get_audience telemetry
...
This will assist with debugging #2720 , by letting us see which kinds of
requests take the longest.
2023-04-04 14:23:15 -04:00
Jacob Torrey
f9c75a43ae
Fixing pylint issues
...
Signed-off-by: Jacob Torrey <jacob@jacobtorrey.com>
2023-04-04 16:46:32 +00:00
Jacob Torrey
797d339132
Move the search request logic into the AbstractConnector to allow for more flexibility
...
Signed-off-by: Jacob Torrey <jacob@jacobtorrey.com>
2023-04-04 16:03:37 +00:00
Josh Soref
def58a3e18
spelling: activity
...
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 11:14:03 -04:00
Mouse Reeve
6e427cf372
Update version number
2023-04-03 21:31:41 -07:00
Jascha Ezra Urbach
d35b1d91ba
Merge pull request #2766 from bookwyrm-social/redirect-in-admin
...
Uses referer redirect for some admin views
2023-04-01 11:06:42 +02:00
Hugh Rundle
499ff58a65
Merge pull request #2698 from rkmdCodes/main
...
Improving Feed link UI colours
2023-04-01 14:27:04 +11:00
Mouse Reeve
c77436fc12
Catch value errors when parsing imported ratings
2023-03-29 20:15:09 -07:00
Mouse Reeve
74df7511e7
Merge pull request #2768 from bookwyrm-social/grammar
...
Fixes effect/affect error
2023-03-29 18:46:14 -07:00
Mouse Reeve
b5d6c94885
Merge pull request #2767 from bookwyrm-social/link-mention-clash
...
Clashes between links and mentions
2023-03-29 17:06:11 -07:00
Mouse Reeve
b76da26c98
Fixes iteration over mentions dict
2023-03-29 10:13:44 -07:00
Mouse Reeve
f1640399e3
Python formatting
2023-03-29 10:13:44 -07:00
Mouse Reeve
f2ab8c2fe2
Fixes effect/affect error
2023-03-29 10:04:23 -07:00
Mouse Reeve
8cf7c5c392
Merge pull request #2750 from WesleyAC/get-audience-telemetry
...
Add more detailed telemetry for get_audience
2023-03-29 09:29:05 -07:00
Mouse Reeve
5ed46abcee
Merge branch 'main' into link-mention-clash
2023-03-29 09:25:34 -07:00
Mouse Reeve
fe856bcf2c
Updates regex on mentions and hashtags
2023-03-29 09:20:58 -07:00
Mouse Reeve
4fcb01805e
Fixes test comparison string
2023-03-29 09:14:30 -07:00
Mouse Reeve
8a0e88db83
Adds test for links with # symbols
2023-03-29 08:39:41 -07:00
Mouse Reeve
42dd199084
Unit test that identifies clashes between links and mentions
2023-03-29 08:28:45 -07:00
Rajat Dwivedi
38e3f2e1b8
Merge branch 'main' into main
2023-03-29 16:37:57 +05:30
Rajat Dwivedi
33c13608a8
Refixing light and dark themes
2023-03-29 10:56:08 +00:00
Mouse Reeve
56cc0eb80f
Adds Esperanto locale
2023-03-28 15:03:40 -07:00
Mouse Reeve
b2801d44a5
Merge pull request #2752 from lostfictions/patch-1
...
Add message about shelf privacy in user settings
2023-03-27 06:21:33 -07:00
Mouse Reeve
30a3096b25
Merge pull request #2749 from bookwyrm-social/redirects
...
Add helper to refer views back to http referers safely
2023-03-27 06:20:26 -07:00
Jascha Ezra Urbach
bbed08e182
Merge branch 'main' into main
2023-03-21 05:49:52 +01:00
s
a70417a07f
Add message about shelf privacy in user settings
2023-03-20 22:10:50 -04:00
Wesley Aptekar-Cassels
7efbdb1865
Add more detailed telemetry for get_audience
...
This is still slow in some cases, despite #2723 , so this information
should give useful data about how it could be optimized more.
This also adds some abstraction around getting the tracer, just to
follow the advice in the OpenTelemetry documentation not to use __name__
directly to set the tracer name. The advice is ignored in most of their
examples, so it probably doesn't matter, but IDK, seems reasonable to
try to follow it.
Related: #2720
2023-03-20 20:51:20 -04:00
Wesley Aptekar-Cassels
ef64fedbd9
Only enable OTLP exporter when configured
...
This wasn't a problem in the past, since we only enabled automatic
instrumentation when this was set up, but it does cause errors when
trying to add manual instrumentation.
2023-03-20 20:51:20 -04:00
Mouse Reeve
e9d08e7424
Merge pull request #2744 from WesleyAC/opentelemetry-console-exporter
...
Add OpenTelemetry console exporter option
2023-03-20 14:26:24 -07:00
Mouse Reeve
89bb541bef
Merge pull request #2704 from tebriel/azure-support
...
Enable Azure BlobStorage as an alternative to AWS S3
2023-03-20 14:12:57 -07:00
Mouse Reeve
6f1e80be60
Merge pull request #2741 from WesleyAC/optimize-csv-export-query
...
Optimize CSV export query
2023-03-20 14:11:46 -07:00
Mouse Reeve
05e154f93e
Uses referer redirect for some admin views
2023-03-20 13:58:20 -07:00
Mouse Reeve
0cebc4388c
Adds unit tests for referer helper
2023-03-20 12:47:21 -07:00
Mouse Reeve
219f78755f
Fixes args in list view redirect
2023-03-20 11:15:27 -07:00
Mouse Reeve
4e9fad2091
Updates views that currently use the validator to use the redirect
...
helper
2023-03-20 10:27:52 -07:00
Mouse Reeve
2de115fc1e
Add helper to refer views back to http referers safely
...
In most cases, we want to return back to where we came from after
performing an action. It's not safe to return to an arbitrary referer,
so this streamlines using the util validator to verify the redirect and
fall back on regular redirect params if the referer is outside our
domain.
2023-03-20 10:25:38 -07:00
Rajat Dwivedi
349c61f698
Updated the _tabs.scss file
2023-03-20 04:11:44 +00:00
Wesley Aptekar-Cassels
63ab3abe67
Add setting for OpenTelemetry console exporter
...
This is primarily useful for debugging changes to the OpenTelemetry
setup.
2023-03-18 15:47:30 -04:00
Wesley Aptekar-Cassels
fea3b67a55
Raise error if using default SECRET_KEY in production
2023-03-18 15:44:20 -04:00
Wesley Aptekar-Cassels
b3d3de5374
Use typecasting env functions
...
Many of these environment variables were probably not actually usable,
since they would be strings if set in the env file. Using the
typecasting functions fixes this, and generally shows the intention of
the code more clearly.
2023-03-18 15:35:08 -04:00
Wesley Aptekar-Cassels
60fee54da9
Optimize CSV export query
...
Splitting this into five separate queries avoids the large join that
prevents us from using indexes, and requires materializing to disk.
Fixes : #2157 (hopefully)
2023-03-13 15:45:21 -04:00
Mouse Reeve
9c1aaadab3
Update verison number and js cachebuster
2023-03-13 07:52:28 -07:00
Wesley Aptekar-Cassels
0b9e4d617e
Use context processor for 500 page
...
By default, Django doesn't run any context processors for server errors,
to make the error path as simple as possible. However, this has the
downside that our template does not load correctly. To fix this, I added
a custom 500 error handler, which will run the context processor.
Fixes : #2736
2023-03-13 03:47:23 -04:00
Mouse Reeve
7ffe5b9440
Adds merge migration
2023-03-12 16:43:06 -07:00
Mouse Reeve
12af5992a3
Merge pull request #2524 from chdorner/feature/tag-support
...
Initial hashtag support
2023-03-12 16:37:39 -07:00
Mouse Reeve
48889ee6c4
Merge pull request #2695 from chdorner/book-edit-form-validation-notification
...
Show notification banner on top of form when book failed to update
2023-03-12 16:33:34 -07:00
Mouse Reeve
2e7eb0f3ce
Merge pull request #2702 from Ryuno-Ki/lazyload-images
...
Add attributes to images to hint async load
2023-03-12 16:31:27 -07:00
Mouse Reeve
6345beb90d
Merge pull request #2714 from WesleyAC/celery-ignore-results
...
Ignore Celery task results
2023-03-12 16:26:20 -07:00
Mouse Reeve
84b8a5c433
Merge pull request #2713 from WesleyAC/buffer-csv-export
...
Change CSV export to buffer instead of streaming
2023-03-12 16:17:53 -07:00
Mouse Reeve
d17190fae3
Merge pull request #2718 from WesleyAC/broaden-dashboard-http-except
...
Broaden except section for HTTP request in dashboard
2023-03-12 16:10:01 -07:00
Mouse Reeve
c28d523e6f
Merge branch 'main' into get-audience-perf
2023-03-12 15:40:53 -07:00
Mouse Reeve
efe3cb9461
Merge pull request #2726 from WesleyAC/optimize-add-remove-book-statuses-task
...
Optimize add/remove book statuses task queries
2023-03-12 15:36:27 -07:00
Wesley Aptekar-Cassels
2a5f722f6e
Optimize add/remove book statuses task queries
...
The queries as they previously existed required joining together 12
different tables, which is extremely expensive. Splitting it into four
queries means that the individual queries can effectively use the
indexes we have, and should be very fast no matter how many statuses are
in the database.
Removing the .distinct() call is fine, since we're adding them to a set
in Redis anyways, which will take care of the duplicates.
It's a bit ugly that we now make four separate calls to Redis (this
might result in things being slightly slower in cases where there are an
extremely small number of statuses), but doing things differently would
result in significantly more surgery to the existing code, so I've opted
to avoid that for the moment.
Fixes : #2725
2023-03-09 15:26:03 -05:00
Wesley Aptekar-Cassels
56243f6529
Optimize HomeStream.get_audience
...
This splits HomeStream.get_audience into two separate database queries,
in order to more effectively take advantage of the indexes we have.
Combining the user ID query and the user following query means that
Postgres isn't able to use the index we have on the userfollows table.
The query planner claims that the userfollows query should be about 20
times faster than it was previously, and the id query should take a
negligible amount of time, since it's selecting a single item by primary
key.
We don't need to worry about duplicates, since there is a constraint
preventing a user from following themself.
Fixes : #2720
2023-03-09 00:50:24 -05:00
Wesley Aptekar-Cassels
23698dafe5
Change get_audience to return list of user IDs
...
This will make it simpler to implement various optimizations.
2023-03-09 00:50:24 -05:00
Wesley Aptekar-Cassels
41e14bdfaf
Change unread_by_status_type_id to take user ID
...
Same reason as in prior commit.
2023-03-09 00:50:24 -05:00
Wesley Aptekar-Cassels
653e8ee81b
Change unread_id to take user ID
...
Same reason as described in the prior commit.
2023-03-09 00:50:24 -05:00
Wesley Aptekar-Cassels
5446869c38
Change stream_id to take user ID
...
Anywhere we have a user object, we can easily get the user ID in the
caller, and this will allow us more flexibility in the future to
implement optimizations that involve knowing a user ID without querying
the database for the user object.
2023-03-09 00:50:16 -05:00
Wesley Aptekar-Cassels
50a81bdfdd
Change CSV export to buffer instead of streaming
...
The idea behind a streaming CSV export was to reduce the amount of
memory used, by avoiding building the entire CSV file in memory before
sending it to the client. However, it didn't work out this way in
practice: the query objects that were created to represent each line
caused Postgres to generate a very large (~200MB on bookwyrm.social)
temp file, not to mention the memory being used by the Query object
likely being similar to, if not larger than that used by the finalized
CSV row.
While we should in the long term run our CSV exports as a Celery task,
this change should allow CSV exports to work on large servers without
causing disk-space problems.
Fixes : #2157
2023-03-08 21:37:56 -05:00
Wesley Aptekar-Cassels
4af4f30cde
Broaden except section for HTTP request in dashboard
...
get_data can return exceptions other than ConnectorException, and when
it does, we want to simply not show the update section, rather than
crashing.
Related: #2717
2023-03-08 21:32:41 -05:00
Chris Moultrie
86675ee944
Example Settings and run black
2023-03-08 14:48:04 -05: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
Mouse Reeve
c3109f1238
Merge branch 'main' into improve-polling-backoff
2023-03-07 13:57:00 -08:00
Mouse Reeve
1350e91971
Merge branch 'main' into book-edit-form-validation-notification
2023-03-07 13:56:23 -08:00
Christof Dorner
ee0a89faf2
Reorder head migration
2023-03-07 22:31:58 +01:00
Christof Dorner
bc0b291d36
Show notification banner on top of form when book failed to update
2023-03-07 21:58:12 +01:00
Wesley Aptekar-Cassels
43ad3d0c15
Improve polling algorithm
...
The existing polling code had a few problems:
* It started the timer for a new request when the first request was
sent, rather than when a response was received.
* It increased the delay regardless of whether the response was a
success or a failure.
This commit changes it to a more standard exponential backoff system,
where it starts with a 5 minute ± 30 second delay, and uses that same
delay until it hits an error, at which point the delay is increased by
10%. Once it receives a successful response again, the delay is reset to
the default.
I suspect this should be nicer on the server, since it avoids the
initial sending of many requests. After about half an hour of leaving
the page open, the request rate for this new code will be higher than
that of the old code, so it's possible that this may cause problems, but
I think that a five-minute request frequency should be pretty reasonable.
2023-03-07 13:15:52 -05:00
Mouse Reeve
05a303ea18
Merge pull request #2690 from bookwyrm-social/link-domain-notifications
...
Create notifications for link domains that need approval
2023-03-07 08:43:14 -08:00
Mouse Reeve
1612217eaa
Merge pull request #2696 from bookwyrm-social/chronological-pagination
...
Only use chronological pagination sometimes
2023-03-07 08:42:43 -08:00
Christof Dorner
9ca9883e0b
Enable finding existing hashtags case-insensitive
...
We should store hashtags case-sensitive, but ensures that an existing
hashtag with different case are found and re-used. for example,
an existing #BookWyrm hashtag will be found and used even if the
status content is using #bookwyrm.
2023-03-07 13:16:45 +01:00
Christof Dorner
f3334b1550
Render hashtag links with data-mention="hashtag" attribute
2023-03-07 13:16:45 +01:00
Christof Dorner
276b255f32
Post-process status.content field to change hashtag URLs
...
Since the status content already contains rendered HTML when we receive an
ActivityPub inbox message it contains links to the mentioned hashtags on the
originating instance.
To fix this on the receiving instance we need to post-process the status content
after successfully storing the status and its many-to-many fields (the one we're
is the `mention_hashtags`). Post-processing means that we run a regex against the
content to find the anchor tags linking to the originating hashtag and replace the
`href` attribute with the URL to the hashtag page on the receiving (local) instance.
2023-03-07 13:16:45 +01:00
Christof Dorner
0fd49d2aea
Mark Hashtag.name field as deduplication field
...
This ensures that when an existing hashtag comes in through ActivityPub federation,
it correctly finds the local one, instead of creating duplicate hashtags.
2023-03-07 13:11:27 +01:00
Christof Dorner
e8a306437f
Reorder migrations to add hashtag one at the end
2023-03-07 13:11:27 +01:00
Christof Dorner
824d4207dc
Try and fix a flaky test
...
Same case as with #2496 , for some reason the URL to the cover just ends with `test.jpg`
2023-03-07 12:59:32 +01:00
Christof Dorner
499aace9fb
Add basic view listing activities from a given hashtag
2023-03-07 12:59:32 +01:00
Christof Dorner
11640f986e
Import hashtags from activitypub statuses
2023-03-07 12:59:31 +01:00
Christof Dorner
ba0fcccfc5
Link hashtags in status content
2023-03-07 12:55:36 +01:00
Christof Dorner
c68304a99b
Parse hashtags and store them in CreateStatus view
2023-03-07 12:55:36 +01:00
Mouse Reeve
c402433587
Merge pull request #2683 from bookwyrm-social/resolve-local-tasks-synchronously
...
Attempt to complete inbox requests synchronously
2023-03-06 19:20:16 -08:00
Chris Moultrie
f8e60f4a89
Enable Azure BlobStorage as an alternative to AWS S3
...
This adds a new storage backend for Azure BlobStorage, I'm running this patch in Azure Kubernetes
hosting all my assets in Azure BlobStorage and it's been stable enough I thought I should commit
this back upstream.
2023-03-05 12:08:16 -05:00
André Jaenisch
9c92ba1698
Add attributes to images to hint async load
...
This was suggested on Matrix a while ago but I only found the time now to move forward with it.
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2023-03-01 14:14:42 +01:00
Rajat Dwivedi
7caa60dba5
Improving Feed link UI colours
2023-02-27 20:14:32 +05:30
Hugh Rundle
bba0d09fa4
Merge branch 'main' into totp-window
2023-02-27 18:21:39 +11:00
Hugh Rundle
3a67727a9a
Merge pull request #2638 from Giebisch/page-range
...
Page Range
2023-02-27 17:39:42 +11:00
Christof Dorner
d1110630db
Use chronological pagination on user profile activity lists
2023-02-26 11:24:00 +01:00
Mouse Reeve
99fc2b7a36
Only use chronological pagination sometimes
...
The timeline uses chronological buttons, but other paginated pages do
not (by default). This also reversed the chronology.
2023-02-25 15:56:58 -08:00
wanjiku
b4e388a975
Replace Next and Previous with Older and Newer
2023-02-24 11:11:55 +03:00
Giebisch
43fe433133
Quotation same start and endposition
2023-02-23 18:40:20 +01:00
Mouse Reeve
268946a77c
Adds missing template and migration files
2023-02-22 10:46:01 -08:00
Mouse Reeve
2470a0fd1c
Create notifications for link domains that need approval
2023-02-22 10:20:07 -08:00
Mouse Reeve
46fe65c3bb
Merge branch 'main' into discover-page-test
2023-02-22 09:19:20 -08:00
Mouse Reeve
fad8e8bdb8
Merge pull request #2687 from chdorner/configurable-csp
...
Add config variable for additional CSP hosts
2023-02-22 08:57:56 -08:00
Mouse Reeve
d57ebe43af
Merge pull request #2688 from 0x29a/fix-discovery-page
...
fix: missing expand variable
2023-02-22 08:53:36 -08:00
Mouse Reeve
0a07607240
Improves discover page test so it catches errors
...
Without `select_subclasses` in the mock, it wasn't actually collecting
any statuses to display, so errors on that view weren't caught in this
test.
2023-02-22 08:43:13 -08:00
0x29a
9b94c1c288
fix: missing expand variable
2023-02-22 17:25:11 +01:00
Mouse Reeve
d2e590a3c2
Merge pull request #2685 from bookwyrm-social/broadcast-queue
...
Use a separate queue for broadcasts
2023-02-22 08:20:33 -08:00
Christof Dorner
3814cb5b58
Add config variable for additional CSP hosts
2023-02-21 22:02:52 +01:00
Mouse Reeve
b167364c5c
Use a separate queue for broadcasts
...
I think this will go a long way to solve the federation delay problems
we're seeing on b.s. I'm not sure at what point adding more queues will
create more problems than it solves, but I do think in this case the
queues are out of balance and moving broadcasts (which are the most
common type of `medium_priority` task at the moment) to their own queue
will be an improvement.
2023-02-20 12:58:41 -08:00
Martynas Sklizmantas
2093c4760b
increasing rsa key size
2023-02-20 21:51:50 +01:00
Mouse Reeve
216be2aeea
Fixes pylint complaints
...
"fixes" as in silences, sorry
2023-02-20 12:24:53 -08:00
Mouse Reeve
12ed0f46f3
Fixes mocks for tests
2023-02-20 12:23:18 -08:00
Mouse Reeve
0211dee0ff
Avoid unnecessary errors when a remote re-sends an Accept
2023-02-20 11:09:42 -08:00
Mouse Reeve
779d2b0694
Attempt to complete inbox requests synchronously
...
When an inbox activity comes in from another fediverse instance, the
behavior prior to this commit was always to immediately give a 200
response to the external server and then create a celery activity
(usually in the MEDIUM_PRIORITY queue) to complete it.
Instead, this would receive a request and try to complete it without
making any http requests (which would make the request take too long to
process). If an external request is required to complete the activity, a
task is created and added to the queue.
Ideally, this will cause some tasks to happen very promptly, and reduce
the load on celery, which would help queued tasks happen more quickly as
well.
One downside is that this will make completing http requests from
external servers slowing (since it's doing a bunch of thinking before
responding).
2023-02-20 11:05:18 -08:00
Mouse Reeve
db207065ce
Update version number
2023-02-20 09:15:38 -08:00
Christof Dorner
dc5b797796
Fix SiteSettings.default_user_auth_group
FK on_delete value
...
The migration uses `RESTRICT` instead of `PROTECT`, which is both more
correct, but also those values need to be identical, otherwise Django
thinks that there's a migration missing and will refuse to apply any
new migrations.
2023-02-18 19:33:25 +01:00
Chris Young
d123cc6b0c
Add default values if not in .env
2023-02-17 11:36:21 +00:00
Chris Young
9460553086
Read TOTP variables from .env
2023-02-17 09:40:31 +00:00
Hugh Rundle
702c79496b
Merge pull request #2652 from chdorner/fix/status-get-no-trim
...
Always expand content status on single status view
2023-02-17 15:18:05 +11:00
Chris Young
867b2ff542
Specify TOTP validity window in settings.py
2023-02-13 15:17:54 +00:00
Mouse Reeve
2c2daf5fdf
Merge pull request #2644 from rrgeorge/rrgeorge/csp
...
Add Content-Security-Policy headers and secure cookies
2023-02-10 16:37:39 -08:00
Mouse Reeve
cc9e94261c
Merge pull request #2637 from MeecoLabs/mobile/dropdown-larger-size
...
UI: larger dropdown size for mobile devices
2023-02-10 15:57:03 -08:00
Chris Young
5bae00b3fe
Expand TOTP validity window
2023-02-09 12:49:05 +00:00
Dustin Steiner
d1f85e4317
fix: books can have non-decimal series numbers
2023-02-07 12:05:20 +00:00
Dustin
b20b52af7f
Merge branch 'main' into book-series-v1
2023-02-07 11:57:39 +00:00
Giebisch
21575fbf3f
Unused variable fix
2023-02-06 14:09:53 +01:00
Giebisch
248eab22ed
Merge branch 'main' into page-range
2023-02-06 14:02:05 +01:00
Giebisch
f65e0b7632
Add Quotation endposition test
2023-02-06 14:00:04 +01:00
Christof Dorner
6af1be28f3
Always expand content status on single status view
...
On the feed view along with other statuses, the body will be trimmed,
but on the single view, there's no need to trim it. This preserves the
logic for spoiler alerts.
2023-02-04 12:52:09 +01:00
Robert George
b82231202c
lint
2023-02-03 12:03:52 -08:00
Robert George
297738dbb1
Merge branch 'rrgeorge/csp' of github.com:rrgeorge/bookwyrm into rrgeorge/csp
2023-02-03 11:53:52 -08:00
Robert George
afe651cd6d
Added img-src * csp exception to search
2023-02-03 11:53:41 -08:00
Christof Dorner
f9a916db09
Merge pull request #2639 from bookwyrm-social/celery-ping
...
Celery ping
2023-02-03 09:40:25 +01:00
Mouse Reeve
fd59fea94e
Update bookwyrm/views/admin/celery_status.py
...
Co-authored-by: Christof Dorner <christof@chdorner.com>
2023-02-02 16:46:36 -08:00
Mouse Reeve
739c384715
Merge branch 'main' into rrgeorge/csp
2023-02-02 16:41:18 -08:00
0x29a
22eeee7368
Urlencode search query
2023-02-02 21:02:57 +01:00
Robert George
6b97702cc4
Fix long line
2023-02-01 13:19:57 -08:00
Robert George
36605efd20
Added support for secure cookies and django-csp
2023-02-01 12:59:10 -08:00
Dustin Steiner
610a4e8a66
chore: run styling
2023-01-31 18:44:09 +00:00
Dustin Steiner
96097f3b58
chore: use bulma override for mobile dropdown instead of classes
2023-01-31 18:33:44 +00:00
Dustin Steiner
90f996ac90
chore: multi line comment for linter
2023-01-31 10:16:44 +00:00
Dustin Steiner
c2a81d88bb
Merge branch 'main' into book-series-v1
2023-01-31 10:06:07 +00:00
Dustin Steiner
f30a0ae714
chore: more dropdown resizes
2023-01-31 08:12:57 +00:00
Dustin Steiner
ed040cd3e4
Merge branch 'main' into mobile/dropdown-larger-size
2023-01-31 08:01:29 +00:00
Mouse Reeve
006ff697b9
Merge pull request #2636 from 0x29a/redundant-db-queries
...
Remove redundant DB queries
2023-01-30 09:03:18 -08:00
Mouse Reeve
686d5625ed
Merge pull request #2627 from MeecoLabs/admin-manually-activate-user
...
Button in admin view to manually activate pending user
2023-01-30 09:01:05 -08:00
Mouse Reeve
46607df7e5
Merge pull request #2628 from chdorner/fix/improve-federated-generatednotes-in-feed
...
Improve feed header for federated generated notes
2023-01-30 08:36:36 -08:00
Mouse Reeve
8f88b72620
Adds info about celery endpoint in admin view
2023-01-30 08:35:24 -08:00
Mouse Reeve
c1090703e2
Adds a ping-able celery url
...
This will let admins set up a check to notify you if celery is not
running.
2023-01-30 08:27:40 -08:00
Giebisch
f085315d70
Added Backend Part
2023-01-30 16:12:14 +01:00
Dustin Steiner
e0505722e1
chore: formatting
2023-01-30 14:45:30 +00:00
Dustin Steiner
f4cde843c0
chore: larger dropdown size for mobile devices
2023-01-30 14:40:33 +00:00
Dustin Steiner
59a8098517
chore: add translations
2023-01-30 08:26:59 +00:00
0x29a
5e87504b22
Remove duplicated editions request from book.html
2023-01-30 06:45:48 +01:00
0x29a
f2d7efe2ba
Remove duplicated readthrough request from comment.html
2023-01-30 06:45:48 +01:00
0x29a
6e1418c5d4
Remove duplicated mentions request from layout.html
2023-01-30 06:45:48 +01:00
0x29a
6ea2513790
Remove duplicated notifications request from layout.html
2023-01-30 06:45:48 +01:00
0x29a
3c52426a1c
Optimize get_suggested_books
2023-01-30 06:45:44 +01:00
Dustin Steiner
0628ccad41
chore: sort editions with series number before edition rank
2023-01-29 11:43:56 +00:00
Dustin
c0e541c7ed
Merge branch 'main' into admin-manually-activate-user
2023-01-29 11:21:31 +00:00
Dustin
23e04c2e62
Merge branch 'main' into book-series-v1
2023-01-29 09:36:52 +00:00
Dustin Steiner
4b64b70753
fix: sort series by float
2023-01-29 09:35:02 +00:00
Ritik Ranjan
adcf9310a0
Fixed Syntax of pluralisation
2023-01-28 21:23:08 +05:30
Ritik Ranjan
a12dc692ce
Merge remote-tracking branch 'origin/main' into pluralization-error
2023-01-28 21:16:36 +05:30
Ritik Ranjan
e5e9e807ca
Splited stirng into two then fixed pluralization error.
2023-01-28 21:11:20 +05:30
Mouse Reeve
d0a0851123
Merge pull request #2629 from 0x29a/performance-fixes
...
Minor performance improvements
2023-01-28 07:18:50 -08:00
Dustin Steiner
f2902e8de5
fix: sort series number as int
2023-01-28 08:38:57 +00:00
Dustin Steiner
952dd0dcdf
style: fix unused parameter linter error
2023-01-28 08:31:41 +00:00
Dustin Steiner
3fdbfe405b
fix: rename activate user form name
2023-01-28 08:31:16 +00:00
Ritik Ranjan
fc599f8b9a
fixed singularisation/pluralisation
...
edited two files
2023-01-28 12:10:06 +05:30
Hugh Rundle
2605b12ed0
fix sass compound selector extensions
...
Sass changed the way compound selectors can be extended, as outlined here:
https://sass-lang.com/documentation/breaking-changes/extend-compound
This commit aligns the styles in shepherd.scss to the nwe compound selector extension format.
2023-01-28 14:18:05 +11:00
0x29a
cbd75dc766
Minor performance improvements
2023-01-27 20:24:53 +01:00
Christof Dorner
46bfc184f5
Improve feed header for federated generated notes
...
This works for wants/started/finished reading generated notes, but not yet for "set a goal".
2023-01-27 17:49:48 +01:00
Dustin Steiner
54aea0654a
style: run linter
2023-01-27 15:47:22 +00:00
Dustin Steiner
3d29524e29
chore: reverse support for localhost domain
2023-01-27 15:45:43 +00:00
Dustin Steiner
07f4300176
feat: button in admin view to manually activate pending user
2023-01-27 15:43:34 +00:00
Dustin Steiner
264d32bf1b
Merge branch 'main' into book-series-v1
2023-01-26 16:43:53 +00:00
Mouse Reeve
90e3661636
Merge pull request #2623 from chdorner/fix/passwordless-redis
...
Fix passwordless redis connection string
2023-01-26 08:41:46 -08:00
Dustin Steiner
ba2ff7e7a5
Merge branch 'main' into book-series-v1
2023-01-26 16:40:32 +00:00
Dustin Steiner
5cc158e3be
Merge branch 'main' into book-series-v1
2023-01-26 16:36:19 +00:00
Christof Dorner
afab255c85
Allow empty broker and activity redis password
2023-01-26 17:24:20 +01:00
Christof Dorner
80d3474cef
Quote redis activity password
...
Same as the broker password in celerywyrm/settings.py
2023-01-26 17:23:55 +01:00
Mouse Reeve
62d1c54b31
Merge pull request #2613 from hughrun/authorized-fetch
...
Enable communication with "authorized_fetch" Mastodon servers
2023-01-26 08:21:34 -08:00