You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On other browsers, File.stream will be undefined; however, Firefox Nightly now adheres to the latest draft of the File API which defines a .stream() method, meaning this line is swapping the content of the file for this stream method and later stringifying and uploading that method.
The original purpose of this line seems to be to keep compatibility with older code, which was supposedly encouraged to set file.stream to the stream to be uploaded. I'm not sure if this is still necessary, especially considering this is apparently undocumented behavior. Deleting this line entirely solves the issue.
If it is necessary to keep compatibility, we could just ensure the file isn't a File before checking for file.stream.
This may be the same issue as #908, as the description of that issue sounds similar.
The text was updated successfully, but these errors were encountered:
Modern browsers now expose a `stream` function on the Blob and File interfaces.
This conflicts with an older style of passing data to the `uploadContent` SDK
method, which supported supplying the data to upload in the `stream` property of
an object.
Since this old style is still in active use in the Matrix JS ecosystem, we
preserve the backwards compatibility for now by checking whether `stream` is a
function.
Fixeselement-hq/element-web#9913Fixes#949
Modern browsers now expose a `stream` function on the Blob and File interfaces.
This conflicts with an older style of passing data to the `uploadContent` SDK
method, which supported supplying the data to upload in the `stream` property of
an object.
Since this old style is still in active use in the Matrix JS ecosystem, we
preserve the backwards compatibility for now by checking whether `stream` is a
function.
This fix has been tested in Firefox Nightly (69), Firefox Release (67), Chrome
Canary (77), and Chrome Stable (75).
Fixeselement-hq/element-web#9913Fixes#949
Under the latest version of Firefox Nightly, upon uploading a file, the following text is always uploaded in place of the files real contents
This seems to be caused by http-api.js:70:
On other browsers,
File.stream
will be undefined; however, Firefox Nightly now adheres to the latest draft of the File API which defines a.stream()
method, meaning this line is swapping the content of the file for thisstream
method and later stringifying and uploading that method.The original purpose of this line seems to be to keep compatibility with older code, which was supposedly encouraged to set
file.stream
to the stream to be uploaded. I'm not sure if this is still necessary, especially considering this is apparently undocumented behavior. Deleting this line entirely solves the issue.If it is necessary to keep compatibility, we could just ensure the
file
isn't aFile
before checking forfile.stream
.This may be the same issue as #908, as the description of that issue sounds similar.
The text was updated successfully, but these errors were encountered: