Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reply fallbacks are incorrectly rendered if they are missing the relationship metadata #4448

Closed
ara4n opened this issue Jun 20, 2021 · 1 comment

Comments

@ara4n
Copy link
Member

ara4n commented Jun 20, 2021

Very long-term bug (since Nov 2018 or so) - if a client sends a reply without a...

    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "$another:event.com"
      }
    }

...block on the event, iOS will misrender the fallback badly - suffixing the response to the blockquote, and then cropping off the bottom of the reply.

For instance:

  {
    "decrypted": {
      "type": "m.room.message",
      "sender": "@erikj:jki.re",
      "content": {
        "body": "> <@matthew:matrix.org> erik: what is the longest path through a fanout path? (as it is longer than the longest network path, right?)\n\nHard to say really, each hop has to be strictly closer in cost than the last",
        "format": "org.matrix.custom.html",
        "formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!nOUsIUkdCEMFqwiMXO:matrix.org/$1542740858118861tLlIU:matrix.org\">In reply to</a> <a href=\"https://matrix.to/#/@matthew:matrix.org\">@matthew:matrix.org</a><br>erik: what is the longest path through a fanout path? (as it is longer than the longest network path, right?)</blockquote></mx-reply>Hard to say really, each hop has to be strictly closer in cost than the last",
        "msgtype": "m.text"
      },
      "event_id": "$1542743465654FTBHk:jki.re",
      "origin_server_ts": 1542743465442,
      "unsigned": {
        "age": 81449840146
      },
      "room_id": "!nOUsIUkdCEMFqwiMXO:matrix.org"
    },
    "encrypted": {
      "content": {
        "algorithm": "m.megolm.v1.aes-sha2",
        "ciphertext": "AwgAEqAGBoicJDF7UKYlBGi/Sj4YcWTBbtV7C8/s1gsxdiQri0Bwsh/d84jUgXEMBBxVQ3vUHOh5B5zACPEG2EP9q/6lJLme4zghUDIlp//JsvLgVhwk25BBNdnDGOkIr+RUnk6p4IVVN/UctAZ2OStk45CuBjwdnDlZKXdpUvtCvMlTJhC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"session_id": "wG1Y5b/0eYrTTm8to3ohoMAubvCw4XdV9cjPqFXIk3s"
      },
      "event_id": "$1542743465654FTBHk:jki.re",
      "origin_server_ts": 1542743465442,
      "room_id": "!nOUsIUkdCEMFqwiMXO:matrix.org",
      "sender": "@erikj:jki.re",
      "type": "m.room.encrypted",
      "unsigned": {
        "age": 81449840146
      },
      "user_id": "@erikj:jki.re",
      "age": 81449840146
    }
  },

is rendered as:

image

(ignore that the screenshot shows me replying rather than Erik; i had to forward it to take a screenshot, because reasons).

Eleweb renders it correctly (modulo missing some vertical whitespace after the blockquote) as:

Screenshot 2021-06-20 at 14 14 04

It should be rendered by iOS to look like this:

image

I think there are other situations which trigger this failure mode, but the TL;DR is that iOS shouldn't misdisplay an event because of a minor problem on the sending client like this. I continue to see this failure mode fairly frequently.

@ara4n
Copy link
Member Author

ara4n commented Jun 21, 2021

Confirmed fixed:

image

@ara4n ara4n closed this as completed Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant