1
0
Commit Graph

162 Commits

Author SHA1 Message Date
Jonathan de Jong
d0a5ebf914
Fix error when encountering malformed Tag objects from Kbin () 2023-12-05 13:59:15 +00:00
Claire
bac9e0b55d
Add variable delay before link verification of remote account links () 2023-11-13 16:17:05 +00:00
Eugen Rochko
0d14fcebae
Change link previews to keep original URL from the status () 2023-11-13 09:58:28 +00:00
Matt Jankowski
0c4e7c06dc
Fix Rails/FindEach cop () 2023-11-06 15:53:29 +00:00
Jeong Arm
8f998cd96a
Handle featured collections without items () 2023-10-27 02:36:22 +00:00
Matt Jankowski
bcd0171e5e
Fix Lint/UselessAssignment cop () 2023-10-19 16:55:06 +02:00
Claire
6273416292
Fix post edits not being forwarded as expected () 2023-09-15 19:54:32 +02:00
Robert R George
cf6f70799b
Add support for federating memorial attribute () 2023-08-23 08:27:24 +02:00
Claire
90ec88d58b
Add support for indexable attribute on remote actors ()
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
2023-08-14 18:54:51 +02:00
Claire
1e3b19230a
Add stricter protocol fields validation for accounts () 2023-07-20 18:23:48 +02:00
Jeong Arm
664b0ca8cb
Check if json body is null on Activitipub::ProcessingWorker () 2023-07-17 15:51:30 +02:00
Claire
999c343946
Fix remote accounts being possibly persisted to database with incomplete protocol values () 2023-07-10 18:42:19 +02:00
Matt Jankowski
668a19a2f3
Fix Performance/DeletePrefix cop () 2023-05-02 21:07:45 +02:00
Matt Jankowski
f1c1dd0118
Rename with_lock to with_redis_lock to avoid confusion with ActiveRecord's method () 2023-05-02 18:16:07 +02:00
Claire
a89b02af92
Check domain suspensions before trying to fetch resources () 2023-05-02 15:22:19 +02:00
Matt Jankowski
0a5f0a8b20
Remove instance variables from helper usage () 2023-04-23 22:35:54 +02:00
Nick Schonning
4ff44be134
Autofix Rubocop Rails/Blank () 2023-02-22 09:57:56 +09:00
Nick Schonning
717683d1c3
Autofix Rubocop remaining Layout rules () 2023-02-20 06:58:28 +01:00
Nick Schonning
2177daeae9
Autofix Rubocop Style/RedundantBegin () 2023-02-19 07:09:40 +09:00
Nick Schonning
e2a3ebb271
Autofix Rubocop Style/IfUnlessModifier () 2023-02-18 12:37:47 +01:00
Nick Schonning
669f6d2c0a
Run rubocop formatting except line length () 2023-02-18 06:56:20 +09:00
Claire
0c9eac80d8
Fix unbounded recursion in post discovery ()
* Add a limit to how many posts can get fetched as a result of a single request

* Add tests

* Always pass `request_id` when processing `Announce` activities

---------

Co-authored-by: nametoolong <nametoolong@users.noreply.github.com>
2023-02-10 22:16:37 +01:00
Nick Schonning
ed570050c6
Autofix Rails/EagerEvaluationLogMessage ()
* Autofix Rails/EagerEvaluationLogMessage

* Update spec for debug block syntax
2023-02-07 03:44:36 +01:00
Claire
bb89f0af8a
Fix ActivityPub::ProcessingWorker error on incoming malformed JSON-LD () 2023-02-06 21:00:58 +01:00
Claire
68dcbcb7bf
Add more specific error messages to HTTP signature verification ()
* Return specific error on failure to parse Date header

* Add error message when preferredUsername is not set

* Change error report to be JSON and include more details

* Change error report to differentiate unknown account and failed refresh

* Add tests
2023-01-18 16:47:56 +01:00
Claire
2644a28cb3
Change remote media files to be downloaded outside of transactions () 2022-12-15 18:09:48 +01:00
Claire
c8849d6cee
Fix unbounded recursion in account discovery ()
* Fix trying to fetch posts from other users when fetching featured posts

* Rate-limit discovery of new subdomains

* Put a limit on recursively discovering new accounts
2022-12-07 00:15:24 +01:00
Claire
625216d8e1
Fix attachments of edited statuses not being fetched ()
* Fix attachments of edited statuses not being fetched

* Fix tests
2022-11-27 20:39:05 +01:00
Claire
a5394980f2
Fix NameError in Webfinger redirect handling in ActivityPub::FetchRemoteActorService () 2022-11-09 20:10:38 +01:00
Eugen Rochko
e98833748e
Fix being able to spoof link verification ()
- Change verification to happen in `default` queue
- Change verification worker to only be queued if there's something to do
- Add `link` tags from metadata fields to page header of profiles
2022-11-09 08:24:21 +01:00
Claire
bbf74498f5
Fix validation error in SynchronizeFeaturedTagsCollectionWorker ()
* Fix followers count not being updated when migrating follows

Fixes 

* Fix validation error in SynchronizeFeaturedTagsCollectionWorker

Also saves remote user's chosen case for hashtags

* Limit remote featured tags before validation
2022-11-07 22:35:53 +01:00
Yamagishi Kazutoshi
94feb2b93f
Fix FetchFeaturedCollectionService spec ()
Regression from 
2022-10-21 11:48:22 +02:00
Takeshi Umeda
b0e3f0312c
Add synchronization of remote featured tags ()
* Add LIMIT of featured tag to instance API response

* Add featured_tags_collection_url to Account

* Add synchronization of remote featured tags

* Deliver update activity when updating featured tag

* Remove featured_tags_collection_url

* Revert "Add featured_tags_collection_url to Account"

This reverts commit cff349fc27b104ded2df6bb5665132dc24dab09c.

* Add hashtag sync from featured collections

* Fix tag name normalize

* Add target option to fetch featured collection

* Refactor fetch_featured_tags_collection_service

* Add LIMIT of featured tag to v1/instance API response
2022-10-20 09:15:52 +02:00
Claire
85890bc80f
Fix crash in FetchRemoteKeyService ()
Fix regression from 
2022-09-24 07:41:01 +02:00
Claire
8cf7006d4e
Refactor ActivityPub handling to prepare for non-Account actors ()
* Move ActivityPub::FetchRemoteAccountService to ActivityPub::FetchRemoteActorService

ActivityPub::FetchRemoteAccountService is kept as a wrapper for when the actor is
specifically required to be an Account

* Refactor SignatureVerification to allow non-Account actors

* fixup! Move ActivityPub::FetchRemoteAccountService to ActivityPub::FetchRemoteActorService

* Refactor ActivityPub::FetchRemoteKeyService to potentially return non-Account actors

* Refactor inbound ActivityPub payload processing to accept non-Account actors

* Refactor inbound ActivityPub processing to accept activities relayed through non-Account

* Refactor how Account key URIs are built

* Refactor Request and drop unused key_id_format parameter

* Rename ActivityPub::Dereferencer `signature_account` to `signature_actor`
2022-09-21 22:45:57 +02:00
Claire
1145dbd327
Improve error reporting and logging when processing remote accounts ()
* Add a more descriptive PrivateNetworkAddressError exception class

* Remove unnecessary exception class to rescue clause

* Remove unnecessary include to JsonLdHelper

* Give more neutral error message when too many webfinger redirects

* Remove unnecessary guard condition

* Rework how “ActivityPub::FetchRemoteAccountService” handles errors

Add “suppress_errors” keyword argument to avoid raising errors in
ActivityPub::FetchRemoteAccountService#call (default/previous behavior).

* Rework how “ActivityPub::FetchRemoteKeyService” handles errors

Add “suppress_errors” keyword argument to avoid raising errors in
ActivityPub::FetchRemoteKeyService#call (default/previous behavior).

* Fix Webfinger::RedirectError not being a subclass of Webfinger::Error

* Add suppress_errors option to ResolveAccountService

Defaults to true (to preserve previous behavior). If set to false,
errors will be raised instead of caught, allowing the caller to be
informed of what went wrong.

* Return more precise error when failing to fetch account signing AP payloads

* Add tests

* Fixes

* Refactor error handling a bit

* Fix various issues

* Add specific error when provided Digest is not 256 bits of base64-encoded data

* Please CodeClimate

* Improve webfinger error reporting
2022-09-20 23:30:26 +02:00
Jeong Arm
6aa83b13ba
Properly delete remote account's avatar/header when fetch/update () 2022-08-15 20:32:21 +02:00
Claire
e0bdaeab65
Fix NoMethodError when resolving a link that redirects to a local post ()
* Fix NoMethodError when resolving a link that redirects to a local post

* Fix tests
2022-05-17 14:52:26 +02:00
Eugen Rochko
6cf57c6765
Refactor how Redis locks are created ()
* Refactor how Redis locks are created

* Fix autorelease duration on account deletion lock
2022-05-13 00:02:35 +02:00
Claire
0597e5db68
Fix ArgumentError when processing pinned posts from Friendica ()
Follow-up to 
2022-05-02 19:34:39 +02:00
Claire
71d02ffcf3
Fix compatibility with Friendica regarding pinned posts ()
* Fix multiple database queries when fetching pinned posts for remote account

* Fix compatibility with Friendica regarding pinned posts

Fixes 

* Add tests
2022-05-02 17:41:01 +02:00
Eugen Rochko
3917353645
Fix single Redis connection being used across all threads ()
* Fix single Redis connection being used across all Sidekiq threads

* Fix tests
2022-04-28 17:47:34 +02:00
Jeong Arm
1de748bf5e
Fix FetchFeaturedCollectionService () 2022-04-13 13:25:42 +02:00
Claire
8f91e304a5
Fix spurious edits and require incoming edits to be explicitly marked as such ()
* Change post text edit to not be considered significant if it's identical after reformatting

* We don't need to clear previous change information anymore

* Require status edits to be explicit, except for poll tallies

* Fix tests

* Add some tests

* Add poll-related tests

* Add HTML-formatting related tests
2022-04-06 21:01:02 +02:00
Claire
454ef42aab
Fix error when encountering invalid pinned posts () 2022-04-06 20:58:23 +02:00
Eugen Rochko
71f2b95106
Fix edits with no actual changes being allowed ()
* Fix edits with no actual changes being allowed locally

* Fix edits with no actual changes being allowed through ActivityPub

* Fix false positive changes caused by description processing in model

* Fix not recording poll expiration update

* Fix test

* Revert changes to ProcessStatusUpdateService

* Various fixes and improvements

* Fix code style issues

* Various changes and improvements

* Add guard clause
2022-03-26 00:38:44 +01:00
Claire
92a86b958e
Fix issues with processing toot edits ()
* Fix searching for an already-known status by URL not working

* Fix Update processing from statuses prior to 20220302232632

`ordered_media_attachment_ids_changed?` would return `true` when going from
`nil` to anything (including `[]`).

* Add tests
2022-03-12 19:33:10 +01:00
Claire
d3aa9cf774
Fix Updates being forwarded even when not processable or causing no change ()
* Fix Updates being forwarded even when not processable or causing no change

* Refactor and ensure status edit is strictly newer than last known edit
2022-03-12 09:30:31 +01:00
Eugen Rochko
ddbe906c25
Fix not updating a status when newer version is fetched manually () 2022-03-12 09:11:36 +01:00
Eugen Rochko
b2cd34474b
Add rate limit for editing () 2022-03-09 20:06:51 +01:00