element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.15k stars 1.99k forks source link

Images are sometimes sent as files (without preview/thumbnail) when upload speed is slow #7069

Closed Edszx closed 1 year ago

Edszx commented 6 years ago

Description

This problem has been there since forever, but i'm finally not being lazy an reporting it properly, when the computer's upload speed is low, say 40KBps for example, sometimes images uploaded to riot are sent as files, meaning, without preview/thumbnail, just a single line of text with the filename that you can click to download, and "X uploaded a file" over it instead of "X sent an image". I think it happens if there is any packet loss while the image is being uploaded.

Steps to reproduce

Log: sent

Screenshots

riot_2018-07-22_01-18-30

riot_2018-07-21_16-02-15

Version information

lampholder commented 6 years ago

Just recording that I haven't been able to reproduce this yet - Chromes 'Slow 3G' network throttling preset didn't work for a 1.1MB png.

Edszx commented 6 years ago

@lampholder I suggest https://github.com/jagt/clumsy to make your network drop packets, thank you for looking into this.

t3chguy commented 6 years ago

This happens when local thumbnailing fails (and thus riot-web is not sure the file is an image after all)

Half-Shot commented 6 years ago

Ugh, https://github.com/matrix-org/matrix-react-sdk/blob/2dc94ac277bfaed6e7a8116ff08bba22ee8fb642/src/ContentMessages.js#L306

repli-a commented 6 years ago

@t3chguy this also still reliably happens with video files across all browsers (see 1752 , 6426). If this could get a little love it would be a huge benefit to quality of life - multimedia is a big part of how users communicate.

t3chguy commented 6 years ago

I tried this and it came down to a browser/low level library fault its the browser passing up an error from some C library, I can't remember the specifics

repli-a commented 6 years ago

I remember on our last go-round that it seemed like ffmpeg failing to thumbnail was the cause. But it was doing it on dirt-common h264 stuff that it should be able to do in its sleep. This now seems like yet another different but similar issue (since it's an image I'm guessing imagemagick is doing the thumbnailing)?

Two different types of media processed by two different programs having the same issue coupled with the fact that it happens on all versions and browsers suggests to me a fault with Riot itself. Forgive the input from the peanut gallery here, but from the outside looking in it seems like the error handling for this process isn't tolerant enough of minor hitches, hangups, and latency and instead just throws its hands up and labels the media m.file if it hits any snags along the way, however momentary.

sevmonster commented 2 years ago

Is this still an issue? I have users that are uploading videos and they are saved as m.file events rather than m.video. I don't know if it's related to this issue, but all the other "my video won't play" issues that I can find were closed as duplicates of this one. It's not #6426 either (if that is still an issue), as the video in question was a 3MB webm.

SamiLehtinen commented 2 years ago

I were one of users suffering from this problem way too often. Haven't seen the problem for a good while. Yet I also switched to much faster server. But based on my experience, I could assume it's not a practical problem anymore. Of course test cases should cover the situations where post fails. If that's done, then this is also technically fixed.

ara4n commented 1 year ago

Just got bitten by this yet again, while on poor wifi. Have rageshaked on it.