Repository navigation
Let writers follow fediverse accounts and read their posts - #495
Merged
Merged
Conversation
Journals could only be followed: the actor's following collection was always empty and the inbox understood only Follow, Undo and Delete. A writer whose journal federates can now follow Mastodon and other fediverse accounts and see their public posts on their own friends page. - Following: /api/federation/following lists, follows (by @user@host, resolved with WebFinger over https, or by profile/actor URL) and unfollows. Every fetch goes through SafeHttpFetcher/UrlPolicy; local accounts, non-federating writers, duplicates and more than activitypub.following.max-per-user (500) follows are refused. A signed Follow is queued; unfollowing queues an Undo embedding it. - Inbox: Accept and Reject are matched by the Follow's id or the embedded Follow and must be signed by the followed actor. Reject keeps the row as REJECTED so the writer sees it was declined. - Posts: public Create/Update/Delete of Notes and Articles from accounts someone here follows (accepted) are stored once per object id, content cleaned with jsoup to text, paragraphs, breaks and nofollow links, attachments kept as links. Update/Delete only from the author; replies to our entries are left to the comments path. Posts older than activitypub.remote-posts.keep-days (30) or whose author nobody follows are purged hourly. - Friends page: the owner, logged in, sees those posts interleaved by date, labelled as from the fediverse and linked to the original, plus a small section to manage the follows. Other visitors see neither. - The following collection counts accepted follows, list kept private. - Cleanup: stopping federation or deleting the account removes the follows and sends the actor Delete to the followed accounts' servers too; a deleted remote actor loses its follows and posts. Migration V1_31 adds activitypub_following and activitypub_remote_post. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Sorry @laffer1, your pull request is larger than the review limit of 150,000 diff characters |
Collaborator
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Nov 2, 2026 8:39p.m. | Review ↗ | |
| Java | Nov 2, 2026 8:39p.m. | Review ↗ | |
| Shell | Nov 2, 2026 8:39p.m. | Review ↗ | |
| JavaScript | Nov 2, 2026 8:39p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
DeepSource reported "incomplete assertion" on verify(httpSignatureService).verify(...): a complete Mockito check of a mocked method that is itself named verify. Marked with skipcq rather than rewritten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DeepSource fails the check on cyclomatic complexity: store was 23 and getFriends 30. store now delegates the authorship checks to ownPost and the field copying to save. getFriends moves the fediverse lookup into fediversePosts and is marked skipcq, as it was over the limit before this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both branches dispatched Create, Update and Delete to their own service. Replies to our entries are now tried first; whatever RemoteReplyService ignores goes on to RemotePostService, which already skips replies to our entries. HANDLED and RETRY from the replies stop there. A deleted or gone actor loses its followers, replies and follows alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Writers whose journals federate can now follow accounts on Mastodon and other fediverse servers. Those accounts' public posts appear on the writer's own friends page.
Following
POST /api/federation/followingtakes@user@host,user@host,acct:user@hostor an https profile/actor URL.SafeHttpFetcher, with every redirect checked.id, be an actor type and have an inbox.Followis queued.activitypub.following.max-per-user(default 500) follows.DELETE /api/federation/following?actor=…) queues anUndowith the original Follow embedded, then removes the row.GETreturns the writer's follows. All three endpoints need a login./users/{u}/followingnow reports the real count of accepted follows. Likefollowers, it never lists them.Incoming posts
CreateandUpdateof a Note or Article that is addressed to Public, comes from an account someone here follows (accepted), and is attributed to the sender, with the object id on the sender's host.<details>.UpdateandDeleteare accepted only from the post's author. An Update that makes a post non-public removes it.activitypub.remote-posts.keep-days(default 30) and posts by accounts nobody here follows.Friends page
Only the writer viewing their own friends page sees fediverse posts. They're merged into the friends' entries by date, marked "from the fediverse" with the author's handle, and link to the original. Other visitors see the page as before.
The same page has a small section to follow an account by
@name@server, list follows with their state, and unfollow. If the writer hasn't turned federation on, it links to journal preferences instead.Cleanup
Testing
RemoteAccountResolverTests,FollowingServiceTests,RemotePostServiceTests,FollowingControllerTests,RemotePostCleanupTests. Extended: inbox, actor, actor deletion, users controller and template, and account tests.V1_31migration and the subquery JPQL on MySQL 8;InboxService, its constructor andInboxControllerTests. This PR leaves replies to our entries to Show fediverse replies to entries as comments #494, so the two orders of dispatch don't clash. Whichever merges later needs a hand merge.🤖 Generated with Claude Code