tuskyapp / Tusky

An Android client for the microblogging server Mastodon
https://tusky.app
GNU General Public License v3.0
2.48k stars 391 forks source link

Trying to open the PDF attachment of a post doesn’t work #4729

Open ariasuni opened 2 days ago

ariasuni commented 2 days ago

Detailed description

On Mastodon when, when I go a post (made with Pleroma) with a PDF attachment, it’s the wrong link that is a 404, instead of the actual link to the PDF file.

Steps to reproduce the problem

  1. Go to a post with a PDF attachment, e.g. https://social.lithio.fr/objects/21a14386-464a-4e9a-9b19-88e5c1207c75
  2. Try to open the attachment
  3. Goes to https://eldritch.cafe/media_proxy/113214773399088541/original instead of https://social.lithio.fr/media/ec7d276e-8d10-4ed8-a75f-f9178849f3a5/Critique%20succincte%20de%20la%20non-mixit%C3%A9%20sans%20hommes%20cisgenres%20queer%20-%20Klanid%20Reckmar.pdf

Debug information

Tusky 26.2

Device:

Google Pixel 7 
Version Android : 14 
Version SDK : 34

Account:

@melunaka@eldritch.cafe 
Version : 4.3.0-beta.1+glitch
connyduck commented 2 days ago

This is very interesting 🧐, thank you for reporting!

Interesting because the Mastodon frontend does not show an attachment at all. The Api returns an url to the attachment, but that one 404s. I don't know how Tusky could work around that, we can't just hit every attachment url and see if it 404s. And we can also not go to the remote url as default, because that would direct way too much traffic to the wrong instances. We could defintely do the same as the Mastodon frontend and not show the attachment to the user, but that sucks. Honestly it is kinda a Mastodon bug. Mastodon should either 1) not return an attachment at all or 2) return a working url.