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

Some messages with images won't show #893

Closed
antoyo-light opened this issue Jul 5, 2023 · 4 comments
Closed

Some messages with images won't show #893

antoyo-light opened this issue Jul 5, 2023 · 4 comments

Comments

@antoyo-light
Copy link

Hi.
Since yesterday, I started seeing messages where the text is "This message contains interactive elements." instead of the real message.
This seems to happen when there's an image attached to it.
Thanks to fix this issue.

@cwegener
Copy link

cwegener commented Jul 6, 2023

For me this started happening three days ago (3 July 2023)
Any received message that contains both text + images will say "This message contains interactive elements." and only the image URL will be displayed, and the original text from the send is no longer shown.

@trygveaa
Copy link
Member

trygveaa commented Jul 6, 2023

I've also started getting this in the last days. Looks like we now have to use the rich_text block (which is undocumented) to get the text of these messages. I'll look into supporting it.

trygveaa added a commit that referenced this issue Jul 6, 2023
Instead of just using the text field of a message, use the rich_text
blocks to format the message.

The main reason for doing this was that messages that include images
suddenly started just having "This message contains interactive
elements." in the text field.

There are some other benefits as well:
 - It fixes some bugs with multiple formatting styles not being applied
   correctly.
 - It fixes links in code blocks not being rendered verbatim (but with
   text and url, like outside code blocks).
 - It fixes code blocks sometimes having newlines after/before ``` and
   sometimes not, depending on how the message was sent.

It looks like messages with images are now back to having the proper
text in the text field (for new messages), so this change isn't
necessary to fix that after all (except for for messages in the history
sent in the last couple of days), but since it fixes other issues as
well, it's best to keep it.

There is one bug left when inline code blocks contains links. Then there
will be ` characters before and after the link, which shouldn't be
there, but I'll leave fixing this for later.

Fixes #354, #550, #893
@trygveaa
Copy link
Member

trygveaa commented Jul 6, 2023

It looks like this isn't happening anymore for new messages, so it may have been an unintentional change. But I had already done most of the fix when I saw that, and the fix also fixes some other things so I kept it. I also see that messages sent in these three days still show up with that text, it's only new messages it's fixed for.

@cwegener
Copy link

cwegener commented Jul 7, 2023

Yes. I can confirm that the issues has just disappeared. Very curious.

The rich_text block support sounds really interesting. I'll definitely will test it out myself. Some of the bugs it fixes sound like bugs that I've certainly encountered myself here and there, but that were low priority enough to ignore.

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

3 participants