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

Editing a reply sends the fallback #1556

Open
progval opened this issue Apr 21, 2022 · 0 comments
Open

Editing a reply sends the fallback #1556

progval opened this issue Apr 21, 2022 · 0 comments
Labels
S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems.

Comments

@progval
Copy link
Contributor

progval commented Apr 21, 2022

Describe the bug

When editing a message which is a reply, the content of <mx-reply> is sent to IRC

To Reproduce
Steps to reproduce the behavior:

  1. Post 1 from IRC
  2. Open the channel in app.element.io, and post 2\n3 (ie. each digit on a line) as a reply
  3. Edit to add a new line with 4
  4. Reply to that, with 5\n6

IRC users see this:

20:10:44 <val> 1
20:10:53 <val[m]1> val: 2
20:10:53 <val[m]1> 3
20:11:05 <val[m]1> > <@val:libera.chat> 1
20:11:06 <val[m]1>  * 2
20:11:06 <val[m]1> 3
20:11:06 <val[m]1> 4
20:11:20 <val[m]1> > <@pinkie:matrix.org> 2... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/6fc0013a83d8999888b0a55e9ec770501b4f641e)

Expected behavior

IRC users should see this:

20:10:44 <val> 1
20:10:53 <val[m]1> val: 2
20:10:53 <val[m]1> 3
20:11:06 <val[m]1>  * val: 2
20:11:06 <val[m]1> 3
20:11:06 <val[m]1> 4
20:11:20 <val[m]1> 5
20:11:20 <val[m]1> 6

Screenshots
Here is how it looks from Element Web:
Screenshot 2022-04-21 at 22-13-59 Element #valtest

Additional context

Source of first message (1):

{
  "content": {
    "body": "1",
    "msgtype": "m.text"
  },
  "origin_server_ts": 1650571844984,
  "sender": "@val:libera.chat",
  "type": "m.room.message",
  "unsigned": {},
  "event_id": "$Y7aqvtzqqPCgdsWxY5xzak6Z28yiveOD3pSyZgmyeXg",
  "room_id": "!sbzvsZTdOjEpyDRhiE:libera.chat"
}

Source of second message, after edit (2\n3\n4):

  "content": {
    "body": "> <@val:libera.chat> 1\n\n * 2\n3\n4",
    "format": "org.matrix.custom.html",
    "formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!sbzvsZTdOjEpyDRhiE:libera.chat/$Y7aqvtzqqPCgdsWxY5xzak6Z28yiveOD3pSyZgmyeXg?via=libera.chat&amp;via=matrix.org&amp;via=e2e.zone\">In reply to</a> <a href=\"https://matrix.to/#/@val:libera.chat\">@val:libera.chat</a><br>1</blockquote></mx-reply> * 2<br>3<br>4",
    "m.new_content": {
      "body": "2\n3\n4",
      "format": "org.matrix.custom.html",
      "formatted_body": "2<br>3<br>4",
      "msgtype": "m.text",
      "org.matrix.msc1767.message": [
        {
          "body": "2\n3\n4",
          "mimetype": "text/plain"
        },
        {
          "body": "2<br>3<br>4",
          "mimetype": "text/html"
        }
      ]
    },
    "m.relates_to": {
      "event_id": "$WJGbB6FKf7z3wJftmVKZtIOwvS_maZM2XmfpLbrqgKU",
      "rel_type": "m.replace"
    },
    "msgtype": "m.text",
    "org.matrix.msc1767.message": [
      {
        "body": "> <@val:libera.chat> 1\n\n * 2\n3\n4",
        "mimetype": "text/plain"
      },
      {
        "body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!sbzvsZTdOjEpyDRhiE:libera.chat/$Y7aqvtzqqPCgdsWxY5xzak6Z28yiveOD3pSyZgmyeXg?via=libera.chat&amp;via=matrix.org&amp;via=e2e.zone\">In reply to</a> <a href=\"https://matrix.to/#/@val:libera.chat\">@val:libera.chat</a><br>1</blockquote></mx-reply> * 2<br>3<br>4",
        "mimetype": "text/html"
      }
    ]
  },
  "origin_server_ts": 1650571865442,
  "sender": "@pinkie:matrix.org",
  "type": "m.room.message",
  "unsigned": {},
  "event_id": "$nTGoO2kFtNT3DToyZRbzgUm1mjRbLXfss47LRLOIjo0",
  "room_id": "!sbzvsZTdOjEpyDRhiE:libera.chat"
}

Source of third message (5\n6):

{
  "content": {
    "body": "> <@pinkie:matrix.org> 2\n> 3\n> 4\n\n5\n6",
    "format": "org.matrix.custom.html",
    "formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!sbzvsZTdOjEpyDRhiE:libera.chat/$WJGbB6FKf7z3wJftmVKZtIOwvS_maZM2XmfpLbrqgKU?via=libera.chat&via=matrix.org&via=e2e.zone\">In reply to</a> <a href=\"https://matrix.to/#/@pinkie:matrix.org\">@pinkie:matrix.org</a><br>2<br />3<br />4</blockquote></mx-reply>5<br>6",
    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "$WJGbB6FKf7z3wJftmVKZtIOwvS_maZM2XmfpLbrqgKU"
      }
    },
    "msgtype": "m.text",
    "org.matrix.msc1767.message": [
      {
        "body": "> <@pinkie:matrix.org> 2\n> 3\n> 4\n\n5\n6",
        "mimetype": "text/plain"
      },
      {
        "body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!sbzvsZTdOjEpyDRhiE:libera.chat/$WJGbB6FKf7z3wJftmVKZtIOwvS_maZM2XmfpLbrqgKU?via=libera.chat&via=matrix.org&via=e2e.zone\">In reply to</a> <a href=\"https://matrix.to/#/@pinkie:matrix.org\">@pinkie:matrix.org</a><br>2<br />3<br />4</blockquote></mx-reply>5<br>6",
        "mimetype": "text/html"
      }
    ]
  },
  "origin_server_ts": 1650571879618,
  "sender": "@pinkie:matrix.org",
  "type": "m.room.message",
  "unsigned": {},
  "event_id": "$7IKjGfTbbWnETAgKZJ1A6TKNC7WkTVNy7tmzXoD72e4",
  "room_id": "!sbzvsZTdOjEpyDRhiE:libera.chat"
}
@justinbot justinbot added T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems. S-Minor Impairs non-critical functionality or suitable workarounds exist labels May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems.
Projects
None yet
Development

No branches or pull requests

2 participants