Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Dendrite needs to support the media config endpoint so some Clients like Desktop can upload files #2513

Closed
jittygitty opened this issue Jun 3, 2022 · 11 comments

Comments

@jittygitty
Copy link

Description:
This ticket was posted at the Element Client/web/Desktop tracker because File Upload was failing from Element Desktop but it was working fine from Android client to the same room on same Dendrite server.

But it seems Element Web/Desktop maintainers do not wish to make it to work via some other mechanism they use for Android, and they told me to open this ticket on Dendrite here instead.

Please see:
element-hq/element-web#22429

(This is similar to issue of initiating Voip calls whether audio or video, fail from Element Desktop but works fine from Android. There also it was said that Dendrite must implement /thirdparty/ for initiating audio/video calls to work, see: #2499 )

So either Dendrite coders need to do a PULL-REQUEST to Element-Web/Desktop and see if they accept a patch to make these things work like on Android, ie without needing Dendrite implementation of media config endpoints or /thirdparty/ or to actually implement these features in Dendrite.

I am guessing a "patch" to the Element Desktop so that it works without needing those would be easier? Yes/No??

Currently uploading files to any room fails if using Dendrite server and Desktop Element.

@spaetz
Copy link
Contributor

spaetz commented Jun 4, 2022

It only seems to fail if you set the max file size to 0, I have set mine to max_file_size_bytes: 52428800 and uploads work just fine from element web. So your description is only true for a setting of 0 (was that not recently fixed?). Your bug report would have been more helpful if it contained that info.
That having said, I have no clue what the media config endpoint is.

There was just recently an issue that was fixed because dendrite did not properly supported:

m.upload.size integer The maximum size an upload can be in bytes. Clients SHOULD use this as a guide when uploading content. If not listed or null, the size limit should be treated as unknown

@spaetz
Copy link
Contributor

spaetz commented Jun 4, 2022

This was supposedly fixed on May 2 in #2408

@jittygitty
Copy link
Author

@spaetz Before I posted this, I had myself also tried changing the 0 just in case got lucky with a simple fix.

But the client message was exactly the same, it still claimed "This file is too large to upload. The file size limit is 0 B but this file is 119.31 KB." But perhaps this is cached in client from initial login and I would need to SIGN OUT and then SIGN IN again on clients? Because Dendrite was restarted, even tried it one more time now and same thing. (I'm using Dendrite "0.8.7+f41931b5" )

Anyway, I guess I could try sign-out and sign in again to see if my 500mb (yea in bytes) max file size propagates and allows me to upload attachment from desktop element. If this is the case, perhaps it should be documented in the config file until its fixed to work with 0/unlimited.

@jittygitty
Copy link
Author

jittygitty commented Jun 4, 2022

@spaetz Well I tried again, and still same problem. So I'm really curious how you got it working. I'm using now in my dendrite yaml max_file_size_bytes set to 524288000 and restarted dendrite and then signed out and signed back in with Desktop Element, and I still have the same exact error when I try to upload any file.

Or are you saying that my 524288000 won't work and only 52428800 is the 'magic' number? I'm using latest version of Desktop Element and pretty recent Dendrite version. Did testing reveal that merge #2409 fixed the issue with Desktop client?

Also, I do not know the details of federation and what happens when a user hosted/signed-in to a Synapse server joins a room on your Dendrite server. But interestingly I get the same error about 0 B even if I try to upload file to user from matrix.org in a "DM" direct message encrypted chat from my Desktop Element user logged into my Dendrite. So I'm a bit baffled what could be different about your setup such that it works.

How can I query Dendrite for the variables set in the dendrite.yaml file to be sure it read my changes from there, it should always read that file on startup, there's no other 'cached' version of it that might get read?

@S7evinK
Copy link
Contributor

S7evinK commented Jun 4, 2022

The only magic number for max_file_size_bytes is 0, which should enable uploading files of any size.

Can you try something like

curl 'https://$yourHomeserver/_matrix/media/r0/config' -H 'Authorization: Bearer $yourAccessToken'

this should return the currently set upload limit.

// Edit:
I can reproduce this.

@jittygitty
Copy link
Author

@S7evinK Thanks, I tried that and seems it confirms yaml was read fine, reports:
{"m.upload.size":524288000}

You were able to reproduce same error I'm getting? If so, I'm even more curious how it works for @spaetz

OH, wait a second, I just noticed right now that @spaets said he tested from Element "WEB", but I'm using Element DESKTOP. I'm guessing its possible Element Web is doing it differently than in Element Desktop?

@S7evinK
Copy link
Contributor

S7evinK commented Jun 5, 2022

Reproducible with max_file_size_bytes: 0, yes. Any other value, like you have set, should work fine.

@spaetz
Copy link
Contributor

spaetz commented Jun 5, 2022

OH, wait a second, I just noticed right now that @spaets said he tested from Element "WEB", but I'm using Element DESKTOP.

Yes, that could well make a difference....

@jittygitty
Copy link
Author

@S7evinK Did you reproduce on Element "Desktop"? On Element Desktop app, I get error with 524288000 also.

@jittygitty
Copy link
Author

@S7evinK @spaetz This seems to have been fixed in Element Desktop Element version: 1.10.14 since right after just upgrading to this latest 1.10.14 I can now upload files/photos attachment from Element Desktop.

@neilalexander
Copy link
Contributor

Will close as solved, shout if it's still a problem going forward.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants