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

Only first text token is rendered #61

Open
senritsu opened this issue Jun 20, 2022 · 13 comments
Open

Only first text token is rendered #61

senritsu opened this issue Jun 20, 2022 · 13 comments
Labels
Help Wanted Community help wanted Type/Bug Something isn't working Up For Grabs Ready for help from the community. Removed when someone volunteers
Milestone

Comments

@senritsu
Copy link

With Mattermost Version 7.0.0 and the Memes plugin 1.4.0 only part of the text displays.

Using the example from the README: /meme everywhere "memes." "memes everywhere" results in:

image

Similarly the example from everywhere.yaml used as /meme geese. geese everywhere also displays just:

image

@mickmister mickmister added Triage and removed Triage labels Sep 6, 2022
@DHaussermann
Copy link

@senritsu thanks for opening this issue. However, I am unable to reproduce it using your example. Both strings are accepted and shown in the resulting meme. I also tried this on a v7.0.0 server and still don't see the issue.

Can you please confirm if it's still happening for you?

@senritsu
Copy link
Author

senritsu commented Sep 7, 2022

Unfortunately I cannot, I have recently changed company and no longer have access to the mattermost installation of my previous employer.

@Gusser93
Copy link

Gusser93 commented Sep 7, 2022

I can confirm the issue for Mattermost-Version: 7.1.2. I'm not able to check the plugin version but I can confirm the issue even with the example from /meme
grafik

@floviolleau
Copy link

floviolleau commented Sep 8, 2022

Hi,

I confirm on 7.0.1, we have the issue and plugin 1.4.0

Any ideas?
Thanks

@DHaussermann
Copy link

@Gusser93 and @floviolleau Thanks for your help in confirming. 👍

I did find a server where I can repro the issue even though it has the same meme build deployed as other servers I've looked at.
I'm trying now to isolate the repro steps.

@DHaussermann DHaussermann added the Type/Bug Something isn't working label Sep 8, 2022
@DHaussermann
Copy link

DHaussermann commented Sep 8, 2022

After a bit of investigation I am unable to determine why only some servers are affected. Tested matching server version, and plugin version. Tested modifying several values regarding posts in the config to see if I can make the issue occur on a server.

The request shows the 2nd string appended
image
And in the response - I can see the & has been encodded
image
But these look exactly the same on a server where the issue does not occur.

Also noticed the Community server is affected by this issue.

Leaving in triage for dev input.

@catalintomai catalintomai modified the milestone: v1.5.0 Sep 12, 2022
@catalintomai catalintomai added Help Wanted Community help wanted Up For Grabs Ready for help from the community. Removed when someone volunteers and removed Triage labels Sep 12, 2022
@DHaussermann DHaussermann added this to the v1.6.0 milestone Sep 13, 2022
@floviolleau
Copy link

Hi,

What do you need as input?

@rltas
Copy link

rltas commented Jan 31, 2023

Still reproducible on 7.7.1. I see this error in the log:
error [2023-01-31 22:58:11.967 +01:00] http: URL query contains semicolon, which is no longer a supported separator; parts of the query may be stripped when parsed; see golang.org/issue/25192 caller="log/log.go:195" source=httpserver

@Gusser93
Copy link

Gusser93 commented Feb 1, 2023

I provide the following information with this hint

https://mattermost.gitlab.rlp.net/api/v4/image?url=https://mattermost.gitlab.rlp.net/plugins/memes/templates/everywhere.jpg?text=Test&text=Test does not work (which is the request used by the mattermost web app). This leads to the request https://mattermost.gitlab.rlp.net/plugins/memes/templates/everywhere.jpg?text=Test&text=Test which does not work. Maybe the problem is the imageproxy in mattermost, which URL-encodes the & but does not reverse the process when redirecting here?

https://mattermost.gitlab.rlp.net/api/v4/image?url=https://mattermost.gitlab.rlp.net/plugins/memes/templates/everywhere.jpg?text=Test&text=Test2 and
https://mattermost.gitlab.rlp.net/api/v4/image?url=https://community.mattermost.com/plugins/memes/templates/everywhere.jpg?text=Test&text=Test do work, when used in the mattermost web app. Please note, that the & is not escaped here. This only works if I write the prompt myself without the /meme command.

I hope this helps.

@MasinAD
Copy link

MasinAD commented Feb 2, 2023

One wild guess: Might it have to do with Mattermost being behind a reverse proxy or not?

@rltas
Copy link

rltas commented Feb 2, 2023

Dunno if this adds anything useful, but this is what I see in the nginx reverse proxy log after entering /meme aliens "Test" "Test":

"GET /api/v4/image?url=https%3A%2F%2Fchat.domain.de%2Fplugins%2Fmemes%2Ftemplates%2Fancient-aliens.jpg%3Ftext%3DTest%26amp%3Btext%3DTest HTTP/1.1"  302
"GET /plugins/memes/templates/ancient-aliens.jpg?text=Test&text=Test HTTP/1.1"  200

Our config's following https://docs.mattermost.com/install/config-proxy-nginx.html

@paoloo
Copy link

paoloo commented Mar 28, 2023

I have the very same issue on desktop and web version, but it renders correctly on the iOS version.

@daerSeebaer
Copy link

I digged into our Mattermost server. The link in the Post in the database is the correct one, without any semicolons. So the issue is that the Mattermost webapp renders this link into an encoded form and introduces an & in the process.

So either someone knows or finds out where that encoding happens and it get's fixed in the Mattermost webapp files, or the plugin catches this and just replaces & with &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Community help wanted Type/Bug Something isn't working Up For Grabs Ready for help from the community. Removed when someone volunteers
Projects
None yet
Development

No branches or pull requests

10 participants