about summary refs log tree commit diff
path: root/app/services/activitypub
AgeCommit message (Collapse)Author
2023-02-22Autofix Rubocop Rails/Blank (#23765)Nick Schonning
2023-02-20Autofix Rubocop remaining Layout rules (#23679)Nick Schonning
2023-02-19Autofix Rubocop Style/RedundantBegin (#23703)Nick Schonning
2023-02-18Autofix Rubocop Style/IfUnlessModifier (#23697)Nick Schonning
2023-02-18Run rubocop formatting except line length (#23632)Nick Schonning
2023-02-10Fix unbounded recursion in post discovery (#23506)Claire
* 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-07Autofix Rails/EagerEvaluationLogMessage (#23429)Nick Schonning
* Autofix Rails/EagerEvaluationLogMessage * Update spec for debug block syntax
2023-02-06Fix ActivityPub::ProcessingWorker error on incoming malformed JSON-LD (#23416)Claire
2023-01-18Add more specific error messages to HTTP signature verification (#21617)Claire
* 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
2022-12-15Change remote media files to be downloaded outside of transactions (#21796)Claire
2022-12-07Fix unbounded recursion in account discovery (#22025)Claire
* 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-11-27Fix attachments of edited statuses not being fetched (#21565)Claire
* Fix attachments of edited statuses not being fetched * Fix tests
2022-11-09Fix NameError in Webfinger redirect handling in ↵Claire
ActivityPub::FetchRemoteActorService (#20260)
2022-11-09Fix being able to spoof link verification (#20217)Eugen Rochko
- 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-07Fix validation error in SynchronizeFeaturedTagsCollectionWorker (#20018)Claire
* Fix followers count not being updated when migrating follows Fixes #19900 * Fix validation error in SynchronizeFeaturedTagsCollectionWorker Also saves remote user's chosen case for hashtags * Limit remote featured tags before validation
2022-10-21Fix `FetchFeaturedCollectionService` spec (#19401)Yamagishi Kazutoshi
Regression from #19380
2022-10-20Add synchronization of remote featured tags (#19380)Takeshi Umeda
* 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-09-24Fix crash in FetchRemoteKeyService (#19225)Claire
Fix regression from #19212
2022-09-21Refactor ActivityPub handling to prepare for non-Account actors (#19212)Claire
* 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-20Improve error reporting and logging when processing remote accounts (#15605)Claire
* 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-08-15Properly delete remote account's avatar/header when fetch/update (#18973)Jeong Arm
2022-05-17Fix NoMethodError when resolving a link that redirects to a local post (#18314)Claire
* Fix NoMethodError when resolving a link that redirects to a local post * Fix tests
2022-05-13Refactor how Redis locks are created (#18400)Eugen Rochko
* Refactor how Redis locks are created * Fix autorelease duration on account deletion lock
2022-05-02Fix ArgumentError when processing pinned posts from Friendica (#18260)Claire
Follow-up to #18254
2022-05-02Fix compatibility with Friendica regarding pinned posts (#18254)Claire
* Fix multiple database queries when fetching pinned posts for remote account * Fix compatibility with Friendica regarding pinned posts Fixes #18066 * Add tests
2022-04-28Fix single Redis connection being used across all threads (#18135)Eugen Rochko
* Fix single Redis connection being used across all Sidekiq threads * Fix tests
2022-04-13Fix FetchFeaturedCollectionService (#18030)Jeong Arm
2022-04-06Fix spurious edits and require incoming edits to be explicitly marked as ↵Claire
such (#17918) * 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-06Fix error when encountering invalid pinned posts (#17964)Claire
2022-03-26Fix edits with no actual changes being allowed (#17843)Eugen Rochko
* 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-12Fix issues with processing toot edits (#17748)Claire
* 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-12Fix Updates being forwarded even when not processable or causing no change ↵Claire
(#17699) * 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-12Fix not updating a status when newer version is fetched manually (#17745)Eugen Rochko
2022-03-09Add rate limit for editing (#17728)Eugen Rochko
2022-03-09Change how changes to media attachments are stored for edits (#17696)Eugen Rochko
* Change how changes to media attachments are stored for edits Fix not being able to re-order media attachments * Fix not broadcasting updates when polls/media is changed through ActivityPub * Various fixes and improvements * Update app/models/report.rb Co-authored-by: Claire <claire.github-309c@sitedethib.com> * Add tracking of media attachment description changes * Change poll in status edit to have a structure closer to the real one Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2022-02-10Fix poll votes not being properly reset on poll change (#17498)Claire
* Fix poll votes not being properly reset on poll change * Fix and add tests * Fix poll update handling when the number of options changes
2022-02-10Add editing for published statuses (#17320)Eugen Rochko
* Add editing for published statuses * Fix change of multiple-choice boolean in poll not resetting votes * Remove the ability to update existing media attachments for now
2022-02-08Remove language detection through cld3 (#17478)Eugen Rochko
* Remove language detection through cld3 * Update app/helpers/languages_helper.rb Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh> Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
2022-02-03Fix compacted JSON-LD possibly causing compatibility issues on forwarding ↵Claire
(#17428)
2022-02-03Compact JSON-LD signed incoming activities (#17426)Claire
Co-authored-by: Puck Meerburg <puck@puck.moe>
2022-01-28Fix Sidekiq warnings about JSON serialization (#17381)Claire
* Fix Sidekiq warnings about JSON serialization This occurs on every symbol argument we pass, and every symbol key in hashes, because Sidekiq expects strings instead. See https://github.com/mperham/sidekiq/pull/5071 We do not need to change how workers parse their arguments because this has not changed and we were already converting to symbols adequately or using `with_indifferent_access`. * Set Sidekiq to raise on unsafe arguments in test mode In order to more easily catch issues that would produce warnings in production code.
2022-01-26Fix poll updates being saved as status edits (#17373)Eugen Rochko
Fix #17344
2022-01-19Fix error when processing poll updates (#17333)Eugen Rochko
Regression from #16697
2022-01-19Add support for editing for published statuses (#16697)Eugen Rochko
* Add support for editing for published statuses * Fix references to stripped-out code * Various fixes and improvements * Further fixes and improvements * Fix updates being potentially sent to unauthorized recipients * Various fixes and improvements * Fix wrong words in test * Fix notifying accounts that were tagged but were not in the audience * Fix mistake
2022-01-19Fix NameError on ActivityPub::FetchFeaturedCollectionService (#17326)Jeong Arm
Related: #16954
2022-01-17Add support for private pinned posts (#16954)Claire
* Add support for private pinned toots * Allow local user to pin private toots * Change wording to avoid "direct message"
2021-11-26Remove Keybase integration (#17045)Eugen Rochko
2021-10-21Add support for fetching Create and Announce activities by URI (#16383)Claire
* Add support for fetching Create and Announce activities by URI This should improve compatibility with ZAP and offer a way to fetch boosts, which is currently not possible. * Add tests
2021-05-19Fix some RedisLocks auto-releasing too fast (#16276)Claire
* Fix Delete and Create-related locks expiring too fast Fixes #16238 By default, RedisLock expires after 10 seconds, which may not be enough to process statuses, especially when those have attached media files. This commit extends those 10 seconds to 15 minutes, which should be plenty enough to handle any status, while being short enough to not waste many sidekiq job retries in the exceedingly rare case in which a sidekiq process would crash when processing a `Create` or `Delete`. * Fix other RedisLock autorelease durations Fixes #15645 - things that only perform a few simple database queries (e.g. finding and saving a record) have been left unchanged, so they'll still use the default 10s duration - things that perform significantly more complex database queries have been changed to a 5 minutes timeout - things that perform multiple HTTP queries have been changed to a 15 minutes timeout
2021-05-11Fix to be able to redownload avatar and header (#16190)Takeshi Umeda
* Fix to reset if header and avatar download fails * Add RedownloadAvatarWorker and RedownloadHeaderWorker