w3c / activitypub

http://w3c.github.io/activitypub/
Other
1.24k stars 78 forks source link

Out-of-order inbox activity delivery #385

Closed snarfed closed 1 year ago

snarfed commented 1 year ago

Inspired by @evanp's issue triage this morning of https://github.com/w3c/activitypub/issues/384: how are servers expected to handle inbox delivery of out-of-order activities that depend on each other?

For example, if I receive an Undo of id abc123 (which I haven't seen before) in my inbox, and then afterward I receive a Follow with id abc123, I'm guessing the expected behavior is that I'd discard the Undo, and when I then get the Follow, it would be valid and I'd process it as usual? Ie, I'm not expected to keep "unmatched" activities like this Undo pending indefinitely so that I can later apply them to matching activities if/when they do arrive later, right?

nightpool commented 1 year ago

In practice I think Mastodon keeps "unmatched" Deletes and Undos around for 30 minutes or so before discarding them, since it's very common to receive those activities milliseconds apart and 30 minutes gives some leeway for retries, etc. (not that it keeps the full activity around, just a Redis key with 30 minutes expiration).

On Wed, Sep 6, 2023, 11:41 AM Ryan Barrett @.***> wrote:

Inspired by @evanp https://github.com/evanp's issue triage this morning https://lists.w3.org/Archives/Public/public-swicg/2023Sep/0001.html of

384 https://github.com/w3c/activitypub/issues/384: how are servers

expected to handle inbox delivery of out-of-order activities that depend on each other?

For example, if I receive an Undo of id abc123 (which I haven't seen before) in my inbox, and then afterward I receive a Follow with id abc123, I'm guessing the expected behavior is that I'd discard the Undo, and when I then get the Follow, it would be valid and I'd process it as usual? Ie, I'm not expected to keep "unmatched" activities like this Undo pending indefinitely so that I can later apply them to matching activities if/when they do arrive later, right?

— Reply to this email directly, view it on GitHub https://github.com/w3c/activitypub/issues/385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABZCV5O5P4G6754LYNGUW3XZCRSHANCNFSM6AAAAAA4NT2ENU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

evanp commented 1 year ago

@snarfed we addressed this during issue triage by adding a primer page here:

https://www.w3.org/wiki/ActivityPub/Primer/Out-of-order_activities