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

Element Web fills in mentions information for code blocks & spoiler tags #25266

Open
clokep opened this issue May 2, 2023 · 3 comments
Open
Labels
A-Notifications O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-GetYourUpdates Z-Spec-Compliance An area where Element doesn't correctly implement the spec

Comments

@clokep
Copy link

clokep commented May 2, 2023

Steps to reproduce

Sending a code-block or a spoiler tag with a pill of another user should not add that user to the mentions property (per MSC3952), it is a bit weird to reproduce, but:

  1. Enable intentional mentions in the labs flags
  2. Create a code block (triple ticks)
  3. Mention a user (@clokep<tab>)
  4. Close the code block (triple ticks)
  5. Send the message
  6. View the resulting message source

Alternately for spoiler tags:

  1. Enable intentional mentions in the labs flags
  2. Type /spoiler @clokep<tab>
  3. Send the message
  4. View the resulting message source

Outcome

What did you expect?

I did not expect the mentioned user to be placed in the org.matrix.msc3952.mentions property and the event to be rendered as normal code.

What happened instead?

  1. The user is placed into the mentions property.
  2. The message itself doesn't have a pill, however (there's no matrix.to link).

Message source for code block:

{
  "room_id": "!asdf,
  "type": "m.room.message",
  "content": {
    "msgtype": "m.text",
    "body": "Hello:\n\n```\nclokep \n```",
    "format": "org.matrix.custom.html",
    "formatted_body": "<p>Hello:</p>\n<pre><code>[clokep](https://matrix.to/#/@clokep:matrix.org) \n</code></pre>\n",
    "org.matrix.msc3952.mentions": {
      "user_ids": [
        "@clokep:matrix.org"
      ]
    }
  }
}

Message source for spoiler:

{
  "room_id": "!asdf",
  "type": "m.room.message",
  "content": {
    "msgtype": "m.text",
    "format": "org.matrix.custom.html",
    "body": "Hi @clokep:matrix.org",
    "formatted_body": "<span data-mx-spoiler>Hi @clokep:matrix.org</span>",
    "org.matrix.msc3952.mentions": {
      "user_ids": [
        "@clokep:matrix.org"
      ]
    }
  }
}

Operating system

All

Browser information

N/A

URL for webapp

develop.element.io

Application version

Element version: 1.11.30 Olm version: 3.2.12

Homeserver

Ask me

Will you send logs?

No

@andybalaam andybalaam added S-Minor Impairs non-critical functionality or suitable workarounds exist O-Occasional Affects or can be seen by some users regularly or most users rarely labels May 3, 2023
@t3chguy t3chguy added the Z-Spec-Compliance An area where Element doesn't correctly implement the spec label May 5, 2023
@Johennes
Copy link
Contributor

@daniellekirkwood should we descope this from Q2? It's a valid bug but also seems fairly minor and we're already beyond what we had hoped to spend on GYU this quarter.

@daniellekirkwood
Copy link
Contributor

It's a nice-to-have for the GYU project

I think all nice-to-haves in the GYU project are descoped from Q2 so as soon as we've hit all the MVP items we can remove them all from our board at once...

@Johennes
Copy link
Contributor

Ok, I see. Let me move it into the backlog status. It currently sits at position two in our To Do queue (which is where I noticed it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Notifications O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-GetYourUpdates Z-Spec-Compliance An area where Element doesn't correctly implement the spec
Projects
None yet
Development

No branches or pull requests

5 participants