1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-30 04:23:07 +03:00

Standardise content type handling in MSC3089 createFile() and createNewVersion() (#2014)

* Provide cross platform compatible versions of createFile() and createNewVersion()

The exist implementations are deprecated as they only work in a browser and support a different type of contents from MatrixClient.uploadContent()

* Fix MSC3089 content upload meta data in NodeJS runtime

* Break unstable createFile() and createNewVersion() instead of deprecating

Test using NodeJS types instead of mocked browser Blob

* chore: remove incorrect comment
This commit is contained in:
Hugh Nimmo-Smith
2021-11-30 09:02:41 +00:00
committed by GitHub
parent 7dcee2eb40
commit db9936e07c
5 changed files with 17 additions and 50 deletions

View File

@ -244,8 +244,7 @@ describe("MSC3089Branch", () => {
it('should create new versions of itself', async () => {
const canaryName = "canary";
const fileContents = "contents go here";
const canaryContents = Uint8Array.from(Array.from(fileContents).map((_, i) => fileContents.charCodeAt(i)));
const canaryContents = "contents go here";
const canaryFile = {} as IEncryptedFile;
const canaryAddl = { canary: true };
indexEvent.getContent = () => ({ active: true, retained: true });