activitypods icon indicating copy to clipboard operation
activitypods copied to clipboard

The mastodon.social instance sends a lot of Delete activities to mypod.store users

Open srosset81 opened this issue 1 year ago • 7 comments

I haven't counted, but at least 100 a day.

This has been reported here (old issues):

  • https://github.com/mastodon/mastodon/issues/20406
  • https://github.com/snarfed/bridgy-fed/issues/284

Apparently offering a shared inbox could reduce the number of activities. But maybe we are not responding correctly (we are sending back an Accept activity)

srosset81 avatar Nov 15 '24 20:11 srosset81

It doesn't seem to have been solved, people are complaining of receiving 50x more Delete activities than actual messages.

I noticed for mypod.store that, sometimes, the same user receive a Delete activity for the same remote user several times in a minute. And every request takes between 1s and 1s30 to be processed, because we do lengthy SPARQL queries to ensure everything is deleted completely.

If we set up shared inboxes, the amount of requests may be reduced but it would still be a lot of requests.

If Mastodon cannot be more reasonable with this kind of requests, I would consider completely ignoring these delete activities (not even storing them in the inbox) when we detect they come from Mastodon users.

srosset81 avatar Nov 15 '24 23:11 srosset81

I'm temporarily not processing delete requests from Mastodon servers to see if it prevents Fuseki from crashing every 30m

srosset81 avatar Nov 15 '24 23:11 srosset81

The expectation by Mastodon is indeed:

If you do not know about the actor already, you can safely ignore such activities

https://github.com/mastodon/mastodon/issues/33290#issuecomment-2544918527

It seems that if ActivityPods does know about the actor, it would be expected to 1) use a locally cached public key to validate the message (because the original public key is no longer available), and 2) then delete all stored data about this actor (which it seems is already done for non-Mastodon actors).

jg10-mastodon-social avatar Oct 25 '25 21:10 jg10-mastodon-social

Thanks for the explanations !

We do not keep a locally cached public key of all actors but we could do that indeed.

We do handle the deletion of a actor's data. But the big question is: how can we notify the other server that all the actor's data have been deleted on our server, and so there is no need to keep on sending hundreds of activities ?

As I wrote, I tried to send back an Accept activity, but it gave no results.

srosset81 avatar Oct 27 '25 14:10 srosset81

My understanding is that if the POST is accepted (202?) then that should be sufficient. I don't think Mastodon is resending for the same actor deletion?

Unfortunately there still seems to be 100s of activities per day just because there's 100s of user deletions per day... The PR to not send to every known server seems stalled since November https://github.com/mastodon/mastodon/pull/22273

jg10-mastodon-social avatar Oct 28 '25 06:10 jg10-mastodon-social

On my servers, I get hundreds of activities for the same user deletion. Maybe this is because I don't use shared inboxes ?

srosset81 avatar Nov 12 '25 12:11 srosset81

If the server is receiving hundreds of delete activities but each actor is receiving one, then yes, my understanding is that shared inboxes are recommended as the solution: https://github.com/immers-space/activitypub-express/issues/94

My testing so far has been with a single actor, so I can't comment based on experience yet...

jg10-mastodon-social avatar Nov 15 '25 21:11 jg10-mastodon-social