Resolve "Add Webhook at FeedManager.filter? for filtering statuses from users' timelines" #40
No reviewers
Labels
No labels
bug
confirmed
critical
discussion
documentation
enhancement
merge-upstream
suggestion
support
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
babka/mastodon-babka!40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "9-add-webhook-at-feedmanager-filter-for-filtering-statuses-from-users-timelines"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #9
added 1 commit
Compare with previous version
added 1 commit
Compare with previous version
added 1 commit
Compare with previous version
The code in call_webhook works. But in testing it on a staging server, it does not seem to be invoked at any point that I can identify.
To summarize the current state of my experimentation and development on this MR:
FeedInsertWorker(andNotifyService). TheFeedInsertWorkeris a sidekiq job that checks if a status should be delivered to a user and if FeedManager.filter returns false, the status is added to a sorted set in redis for that specific timeline type and user (key:feed:home:<user id>for example).AccountConversation. Thus a call to the webhook would have to occur in the controller here as well. This is a more difficult problem than with 3, because conversations and direct messages are the way that spam was delivered during the last few spam waves and it is thus vital that we are able to filter these messages as well.TL;DR: This MR works for the Home and List feed, but not for the public, local, tag feed or direct messages. These later four cases would have to invoke the webhook inside the controller, which leads to performance problems (though these could be reduced by using Mastodon's own redis cache).
Upon reflection, I think it might be possible to invoke the webhook when an
AccountConversationobject is created (all relevant information should already be available) and only create theAccountConversationif the webhook succeeds.added 1 commit
d02a9376- Invoke a webhook in FeedManager.filter containing the status id and account id to filter forCompare with previous version
I can report that this MR works on the testing instance for the:
And does not work for:
These last three use the
/api/v1/timelines/publicwith different parameters and directly query the SQL database. To implement the webhook for these feeds a request would have to be made from within the controller for every status that is being returned (defaults to 20 statuses to check per API call, 20 webhook calls per API call).The question for the next meeting is thus:
Should we try to find a work-around for the public timelines or deploy this MR as is with Wispwot to babka.social?
added 1 commit
dd8e2a26- Add CI job to run rspec unit testsCompare with previous version
mentioned in merge request !24
added 1 commit
Compare with previous version
added 1 commit
Compare with previous version
added 1 commit
f4a48dc1- Add rspec test for FeedManager webhookCompare with previous version
added 1 commit
Compare with previous version
I've been able to add a passing unit test for this Webhook.
marked this merge request as ready
added 2 commits
cc073628- Add event field to feedmanager webhook1f3928ef- Add sender field with ID of the account sending a status to check in webhookCompare with previous version
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.