Question about array of activities with Tombstone/Delete #411

Closed
opened 2026-02-02 08:26:46 +00:00 by wiktor-k · 2 comments

Hi folks,

I've been getting activities from FoundKey and noticed that the Tombstone/Deletes are always packed in an array, like so:

[ // <-- notice the array here
  {
    "@context": [
      "https://www.w3.org/ns/activitystreams",
      "https://w3id.org/security/v1",
      {
        "Emoji": "toot:Emoji",
        "Hashtag": "as:Hashtag",
        "PropertyValue": {
          "@context": {
            "name": "schema:name",
            "value": "schema:value"
          },
          "@id": "schema:PropertyValue"
        },
        "_misskey_quote": {
          "@id": "misskey:_misskey_quote",
          "@type": "@id"
        },
        "_misskey_talk": {
          "@id": "misskey:_misskey_talk",
          "@type": "xsd:boolean"
        },
        "discoverable": {
          "@id": "toot:discoverable",
          "@type": "xsd:boolean"
        },
        "featured": {
          "@id": "toot:featured",
          "@type": "@id"
        },
        "isCat": {
          "@id": "misskey:isCat",
          "@type": "xsd:boolean"
        },
        "manuallyApprovesFollowers": {
          "@id": "as:manuallyApprovesFollowers",
          "@type": "xsd:boolean"
        },
        "misskey": "https://misskey-hub.net/ns#",
        "quoteUri": {
          "@id": "http://fedibird.com/ns#quoteUri",
          "@type": "@id"
        },
        "schema": "http://schema.org/",
        "sensitive": {
          "@id": "as:sensitive",
          "@type": "xsd:boolean"
        },
        "toot": "http://joinmastodon.org/ns#",
        "vcard": "http://www.w3.org/2006/vcard/ns#",
        "xsd": "http://www.w3.org/2001/XMLSchema#"
      }
    ],
    "actor": "https://wake.0am.jp/users/a7gdp23028",
    "id": "https://wake.0am.jp/7de54a42-9695-4d73-9477-84b992be3fb5",
    "object": {
      "id": "https://wake.0am.jp/notes/ai8ghvmj3o",
      "type": "Tombstone"
    },
    "published": "2026-02-02T08:13:03.488Z",
    "type": "Delete"
  }
]

I think this comes from the following line of code:

deliverMultipleToRelays(fetchedUser, content),

I'm trying to understand if this is allowed ActivityPub behavior or a bug somewhere. I've read the relevant specs but can't find anything about sending arrays of activities. Would you be able to help me with clarifying the behavior here?

Thank you for your time and have a nice day! 👋

Hi folks, I've been getting activities from FoundKey and noticed that the Tombstone/Deletes are always packed in an array, like so: ```json [ // <-- notice the array here { "@context": [ "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", { "Emoji": "toot:Emoji", "Hashtag": "as:Hashtag", "PropertyValue": { "@context": { "name": "schema:name", "value": "schema:value" }, "@id": "schema:PropertyValue" }, "_misskey_quote": { "@id": "misskey:_misskey_quote", "@type": "@id" }, "_misskey_talk": { "@id": "misskey:_misskey_talk", "@type": "xsd:boolean" }, "discoverable": { "@id": "toot:discoverable", "@type": "xsd:boolean" }, "featured": { "@id": "toot:featured", "@type": "@id" }, "isCat": { "@id": "misskey:isCat", "@type": "xsd:boolean" }, "manuallyApprovesFollowers": { "@id": "as:manuallyApprovesFollowers", "@type": "xsd:boolean" }, "misskey": "https://misskey-hub.net/ns#", "quoteUri": { "@id": "http://fedibird.com/ns#quoteUri", "@type": "@id" }, "schema": "http://schema.org/", "sensitive": { "@id": "as:sensitive", "@type": "xsd:boolean" }, "toot": "http://joinmastodon.org/ns#", "vcard": "http://www.w3.org/2006/vcard/ns#", "xsd": "http://www.w3.org/2001/XMLSchema#" } ], "actor": "https://wake.0am.jp/users/a7gdp23028", "id": "https://wake.0am.jp/7de54a42-9695-4d73-9477-84b992be3fb5", "object": { "id": "https://wake.0am.jp/notes/ai8ghvmj3o", "type": "Tombstone" }, "published": "2026-02-02T08:13:03.488Z", "type": "Delete" } ] ``` I think this comes from the following line of code: https://akkoma.dev/FoundKeyGang/FoundKey/src/commit/8a4216a37065d41880d253105ec3a7fe0c395b7d/packages/backend/src/services/note/delete.ts#L108 I'm trying to understand if this is allowed ActivityPub behavior or a bug somewhere. I've read the relevant specs but can't find anything about sending arrays of activities. Would you be able to help me with clarifying the behavior here? Thank you for your time and have a nice day! 👋
Owner

I've noticed this behaviour from the particular instance you show in your example (wake.0am.jp) too since a while, but I am not sure where it is coming from. I would classify this as a bug and not in line with the ActivityStreams Technical Recommendation.

I'm guessing this might be the case because the particular instance is stuck on some broken older version/commit of Foundkey or perhaps they cherry-picked some commits while leaving out others. In particular, they might be missing commit 1bce487965.

As a more technical explanation: Foundkey in some cases, like deletion of notes, internally groups activities for delivery. This is done by handing an array of activities to the delivery queue. This mechanism is the same for DeliveryManager.execute and deliverMultipleToRelays, since in the end they both insert things into the delivery queue (using the deliver function).

Though the queue worker upon seeing an array should deliver all the activities in separate requests, as implemented in the commit mentioned above. The intended advantage is to use keep-alive HTTP connections more effectively.

I've noticed this behaviour from the particular instance you show in your example (`wake.0am.jp`) too since a while, but I am not sure where it is coming from. I would classify this as a bug and not in line with the ActivityStreams Technical Recommendation. I'm guessing this might be the case because the particular instance is stuck on some broken older version/commit of Foundkey or perhaps they cherry-picked some commits while leaving out others. In particular, they might be missing commit 1bce4879651ee9769db7832c797b7c5338491ff9. As a more technical explanation: Foundkey in some cases, like deletion of notes, internally groups activities for delivery. This is done by handing an array of activities to the delivery queue. This mechanism is the same for `DeliveryManager.execute` and `deliverMultipleToRelays`, since in the end they both insert things into the delivery queue (using the `deliver` function). Though the queue worker upon seeing an array should deliver all the activities in separate requests, as implemented in the commit mentioned above. The intended advantage is to use keep-alive HTTP connections more effectively.
Author

I'm guessing this might be the case because the particular instance is stuck on some broken older version/commit of Foundkey or perhaps they cherry-picked some commits while leaving out others. In particular, they might be missing commit 1bce487965.

Oh, understood! That explains why I couldn't find the exact issue in your recent codebase 😅

So I guess this issue is solved and I'm going to close it.

Much appreciated you taking the time to thoroughly explain it 🙇‍♂️

Have a great day! 👋

> I'm guessing this might be the case because the particular instance is stuck on some broken older version/commit of Foundkey or perhaps they cherry-picked some commits while leaving out others. In particular, they might be missing commit 1bce487965. Oh, understood! That explains why I couldn't find the exact issue in your recent codebase 😅 So I guess this issue is solved and I'm going to close it. Much appreciated you taking the time to thoroughly explain it 🙇‍♂️ Have a great day! 👋
Sign in to join this conversation.
No labels
feature
fix
upkeep
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FoundKeyGang/FoundKey#411
No description provided.