vitorpamplona / amethyst

Nostr client for Android
MIT License
1.17k stars 158 forks source link

[BUG] Amethyst fails to display images if there is no space before image URL #1149

Open dmnyc opened 1 month ago

dmnyc commented 1 month ago

One common reason images fail to load is the syntax created by one client being interpreted incorrectly by another.

In this case, images uploaded by Primal are breaking on Amethyst because the client isn't adding an extra space or line break before the URL.

Most other clients can display these images normally, but Amethyst does not, only showing the image URL instead.

I'm asking for Amethyst to follow what other clients already do: recognize the user intent to display an image, and parse these links correctly.

Examples:

https://primal.net/e/note149zzl7vgaud890s49fgel4rmn7lknv6v6gp3tu2hcc6f2yjqnrcqnxyesa

https://nostrudel.ninja/#/n/nevent1qqs2j3p0lxyw7xnjhc2j55vl63ael0mfkdxdyqc479tuvdy4zfqf3uqpzfmhxue69uhhqatjwpkx2urpvuhx2ucpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3camnwvaz7tmwdaehgu3wvf5hgcm0d9hx2u3wwdhkx6tpdsqs6amnwvaz7tmwdaejumr0dsl7jwdl

https://iris.to/nevent1qqs2j3p0lxyw7xnjhc2j55vl63ael0mfkdxdyqc479tuvdy4zfqf3uqpzfmhxue69uhhqatjwpkx2urpvuhx2ucpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3camnwvaz7tmwdaehgu3wvf5hgcm0d9hx2u3wwdhkx6tpdsqs6amnwvaz7tmwdaejumr0dsl7jwdl

https://coracle.social/nevent1qqs2j3p0lxyw7xnjhc2j55vl63ael0mfkdxdyqc479tuvdy4zfqf3uqpzfmhxue69uhhqatjwpkx2urpvuhx2ucpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3camnwvaz7tmwdaehgu3wvf5hgcm0d9hx2u3wwdhkx6tpdsqs6amnwvaz7tmwdaejumr0dsl7jwdl

image

vitorpamplona commented 1 month ago

We could do this. But I would love if the writing client fixed this instead.

I hope we all agree that these posts just make the parser much more difficult than what it could be and makes the job of new clients much harder.

URL schemes should have a space before them. This is not hard.

dmnyc commented 1 month ago

I completely agree with you and I've reported this to Primal as well. Hopefully they will fix that as it is definitely a bug. However, as an interim fix I'd like to see these posts not appear broken on the most popular Android client.

dmnyc commented 1 month ago

Also, Primal implementing a fix would still not solve the existing issue on the note I mentioned, only future ones.

vitorpamplona commented 1 month ago

Maybe it shouldn't be solved to force this fix at the writing side so that new clients don't need to worry about this.

dmnyc commented 1 month ago

That kind of punishes and confuses users who see malformed notes on Amethyst (since they look normal on all other major clients) and assume Amethyst is broken. But it's your call.

vitorpamplona commented 1 month ago

It also punishes the writer and the writer's app because the image will not show up, links won't work and it just won't attract users to the link, failing to make the point the writer wants.

The writer can always delete the post and write again with the fix. This seems like a better future than requiring every single client to code an advanced parser to figure out what's a link and what's not.

dmnyc commented 1 month ago

This is exactly how I anticipated this conversation would go.

Anyway, I'm an advocate for the user, and don't like the idea of punishing them or forcing them to (attempt to) delete their posts because two clients aren't cooperating.

BTW, I found the same issue on Coracle, submitted it, and it was fixed within a few hours.