[bug] Valid EmojiReacts with custom emoji are discarded if tag is an object instead of an aray #720

Closed
opened 2024-03-09 01:15:46 +00:00 by zotan · 2 comments

Your setup

From source

Extra details

No response

Version

3.10.4-1-gebfb617b

PostgreSQL version

14

What were you trying to do?

When receiving an emoji reaction (EmojiReact) with a custom emoji, it's discarded (Unhandled activity) when the tag property is just an object (which is valid JSON-LD, and the canonical way it's compacted), instead of an array.

Example activity:

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    {
      "Bite": "https://ns.mia.jetzt/as#Bite",
      "Emoji": "toot:Emoji",
      "EmojiReact": "http://litepub.social/ns#EmojiReact",
      "Hashtag": "as:Hashtag",
      "PropertyValue": "schema:PropertyValue",
      "_misskey_content": "misskey:_misskey_content",
      "_misskey_quote": "misskey:_misskey_quote",
      "_misskey_reaction": "misskey:_misskey_reaction",
      "_misskey_summary": "misskey:_misskey_summary",
      "_misskey_talk": "misskey:_misskey_talk",
      "_misskey_votes": "misskey:_misskey_votes",
      "discoverable": "toot:discoverable",
      "featured": {
        "@id": "toot:featured",
        "@type": "@id"
      },
      "fedibird": "http://fedibird.com/ns#",
      "isCat": "misskey:isCat",
      "manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
      "misskey": "https://misskey-hub.net/ns#",
      "movedTo": {
        "@id": "as:movedTo",
        "@type": "@id"
      },
      "movedToUri": "as:movedTo",
      "quoteUri": "fedibird:quoteUri",
      "quoteUrl": "as:quoteUrl",
      "schema": "http://schema.org#",
      "sensitive": "as:sensitive",
      "toot": "http://joinmastodon.org/ns#",
      "value": "schema:value",
      "vcard": "http://www.w3.org/2006/vcard/ns#"
    }
  ],
  "actor": "https://next.e2net.social/users/9psskvkddch67e04",
  "cc": [
    "https://akko.staging.e2net.social/users/zotan"
  ],
  "content": ":shrimp:",
  "id": "https://next.e2net.social/reactions/9qmvudvfgni1vq1f",
  "nickname": "zotan",
  "object": {
    "attributedTo": [],
    "cc": [
      "https://akko.staging.e2net.social/users/zotan"
    ],
    "id": "https://akko.staging.e2net.social/objects/2f9088e2-e5ee-4922-8deb-3065f33085be",
    "to": [],
    "type": "Note"
  },
  "tag": {
    "icon": {
      "type": "Image",
      "url": "https://e2net-next.cdn.ztn.sh/emoji/shrimp.png"
    },
    "id": "https://e2net-next.cdn.ztn.sh/emoji/shrimp.png",
    "name": "shrimp",
    "type": "Emoji"
  },
  "type": "EmojiReact"
}

What did you expect to happen?

No response

What actually happened?

No response

Logs

No response

Severity

I cannot use it as easily as I'd like

Have you searched for this issue?

  • I have double-checked and have not found this issue mentioned anywhere.
### Your setup From source ### Extra details _No response_ ### Version 3.10.4-1-gebfb617b ### PostgreSQL version 14 ### What were you trying to do? When receiving an emoji reaction (`EmojiReact`) with a custom emoji, it's discarded (`Unhandled activity`) when the `tag` property is just an object (which is valid JSON-LD, and the canonical way it's compacted), instead of an array. Example activity: ``` { "@context": [ "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", { "Bite": "https://ns.mia.jetzt/as#Bite", "Emoji": "toot:Emoji", "EmojiReact": "http://litepub.social/ns#EmojiReact", "Hashtag": "as:Hashtag", "PropertyValue": "schema:PropertyValue", "_misskey_content": "misskey:_misskey_content", "_misskey_quote": "misskey:_misskey_quote", "_misskey_reaction": "misskey:_misskey_reaction", "_misskey_summary": "misskey:_misskey_summary", "_misskey_talk": "misskey:_misskey_talk", "_misskey_votes": "misskey:_misskey_votes", "discoverable": "toot:discoverable", "featured": { "@id": "toot:featured", "@type": "@id" }, "fedibird": "http://fedibird.com/ns#", "isCat": "misskey:isCat", "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", "misskey": "https://misskey-hub.net/ns#", "movedTo": { "@id": "as:movedTo", "@type": "@id" }, "movedToUri": "as:movedTo", "quoteUri": "fedibird:quoteUri", "quoteUrl": "as:quoteUrl", "schema": "http://schema.org#", "sensitive": "as:sensitive", "toot": "http://joinmastodon.org/ns#", "value": "schema:value", "vcard": "http://www.w3.org/2006/vcard/ns#" } ], "actor": "https://next.e2net.social/users/9psskvkddch67e04", "cc": [ "https://akko.staging.e2net.social/users/zotan" ], "content": ":shrimp:", "id": "https://next.e2net.social/reactions/9qmvudvfgni1vq1f", "nickname": "zotan", "object": { "attributedTo": [], "cc": [ "https://akko.staging.e2net.social/users/zotan" ], "id": "https://akko.staging.e2net.social/objects/2f9088e2-e5ee-4922-8deb-3065f33085be", "to": [], "type": "Note" }, "tag": { "icon": { "type": "Image", "url": "https://e2net-next.cdn.ztn.sh/emoji/shrimp.png" }, "id": "https://e2net-next.cdn.ztn.sh/emoji/shrimp.png", "name": "shrimp", "type": "Emoji" }, "type": "EmojiReact" } ``` ### What did you expect to happen? _No response_ ### What actually happened? _No response_ ### Logs _No response_ ### Severity I cannot use it as easily as I'd like ### Have you searched for this issue? - [x] I have double-checked and have not found this issue mentioned anywhere.
zotan added the
bug
label 2024-03-09 01:15:46 +00:00
zotan changed title from [bug] to [bug] Valid EmojiReacts with custom emoji are discarded if tag is an object instead of an aray 2024-03-09 01:16:14 +00:00
Member

this will be fixed by #739

On a tangential note, i see this sample (from IceShrimp.NET?), like Akkoma, also uses the image url as an Emoji id. This was reported to be problematic with suboject refetches: #694

The leading idea currently is to just send emoji as any anonymous (sub)object (explicit null id). *oma never reads emoji ids anyway atm and iirc from checking Misskey code it explicitly handled incoming null ids gracefully (but also never attempts to refetch from id) and presents its own emoji as proper, fetchable objects.
I don’t know how Mastodon/Fedibird will handle null ids.

You’ll might also want to use a fetchable ids or null here.

this will be fixed by #739 On a tangential note, i see this sample *(from IceShrimp.NET?)*, like Akkoma, also uses the image url as an Emoji id. This was reported to be problematic with suboject refetches: https://akkoma.dev/AkkomaGang/akkoma/issues/694 The leading idea currently is to just send emoji as any anonymous (sub)object *(explicit `null` id)*. \*oma never reads emoji `id`s anyway atm and iirc from checking Misskey code it explicitly handled incoming `null` ids gracefully (but also never attempts to refetch from `id`) and presents its own emoji as proper, fetchable objects. I don’t know how Mastodon/Fedibird will handle null ids. You’ll might also want to use a fetchable `id`s or `null` here.
Author

@Oneric & @puckipedia: thank you. Fixed in 333611f65e

@Oneric & @puckipedia: thank you. Fixed in https://iceshrimp.dev/iceshrimp/Iceshrimp.NET/commit/333611f65eb2a65b2779ece0435b5ba84bf60e99
Sign in to join this conversation.
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: AkkomaGang/akkoma#720
No description provided.