mautrix/meta

Unable to send media over Messenger

Virkkunen opened this issue · 3 comments

I'm unable to send any media over Messenger, using any client (Element Web, Element X, SchildiChat, FluffyChat), with the message
⚠ Your message may not have been bridged: failed to upload media: failed to parse mercury response: got invalid metadata type, cannot proceed with type assertion: <nil>

The source for one of the images I tried to send

{
  "type": "m.room.message",
  "sender": "@vrkknn:vrkknn.net",
  "content": {
    "body": "1058358960625059369.png",
    "info": {
      "h": 534,
      "mimetype": "image/png",
      "size": 9737,
      "thumbnail_info": {
        "h": 534,
        "mimetype": "image/jpeg",
        "size": 25937,
        "w": 534
      },
      "thumbnail_url": "mxc://vrkknn.net/uJnXGjXSgBuWSZiftBDUvniM",
      "w": 534,
      "xyz.amorgan.blurhash": "KDL.Y2I=0E=OWV^h05od~2"
    },
    "msgtype": "m.image",
    "url": "mxc://vrkknn.net/EoPJwGUCxOEmQKVcExtUeMyP"
  },
  "origin_server_ts": 1708680797774,
  "unsigned": {
    "age": 54
  },
  "event_id": "$37TrB5QvKymCLx42NUAl8g9AFtNxcYCfwWBi9jVnZWs",
  "room_id": "!exwpRQianGBrZdaKqY:vrkknn.net"
}

I was able to send media messages up until yesterday (22/02) without any issues. I haven't pulled any changes/updated the bridge since then.

It seems some images sent via the Messenger app aren't bridging properly too:

Unrecognized blob attachment type

[Click here to open in Messenger](https://www.messenger.com/t/<ID>)
{
  "type": "m.room.message",
  "room_id": "!exwpRQianGBrZdaKqY:vrkknn.net",
  "sender": "@vrkknn:vrkknn.net",
  "content": {
    "body": "Unrecognized blob attachment type\n\nOpen in Messenger: https://www.messenger.com/t/<ID>",
    "external_url": "https://www.messenger.com/t/<ID>",
    "fi.mau.double_puppet_source": "mautrix-meta",
    "fi.mau.unsupported": true,
    "format": "org.matrix.custom.html",
    "formatted_body": "Unrecognized blob attachment type<br><br><a href=\"https://www.messenger.com/t/<ID>\">Click here to open in Messenger</a>",
    "m.mentions": {},
    "msgtype": "m.notice"
  },
  "origin_server_ts": 1708678491015,
  "unsigned": {
    "age": 2146557
  },
  "event_id": "$t1eLru0hsxeaY2NjuAC8Vu_MA2qXjLoYRuaJlG4aK8M",
  "user_id": "@vrkknn:vrkknn.net",
  "age": 2146557
}

The latest version should show a better error when uploading

This issue is propping up again on version v0.1.0+dev.[7941e937] (Mar 11 2024, 20:19:20)
The message now shows: ⚠ Your message may not have been bridged: failed to upload media: failed to unmarshal image metadata in upload response: json: cannot unmarshal string into Go struct field ImageMetadata.image_id of type int64
Message source:

{
  "type": "m.room.message",
  "sender": "@vrkknn:vrkknn.net",
  "content": {
    "body": "image.png",
    "info": {
      "size": 5374,
      "mimetype": "image/png",
      "w": 154,
      "h": 45,
      "xyz.amorgan.blurhash": "LIRW3jWBjZt7~qRjxuofM_M{oft7"
    },
    "msgtype": "m.image",
    "m.mentions": {},
    "url": "mxc://vrkknn.net/IJiGFoUHtKCRBVqdNiVGUZkl"
  },
  "origin_server_ts": 1710316922066,
  "unsigned": {
    "age": 67,
    "transaction_id": "m1710316921940.51"
  },
  "event_id": "$3DAVlqk3gtKvoqaSZLLplnxsjFY256TBSIfsJcZCJHY",
  "room_id": "!exwpRQianGBrZdaKqY:vrkknn.net"
}