Skip to content

Commit

Permalink
Update matrix-sdk-crypto-nodejs to 0.2.0-beta.1 (#44)
Browse files Browse the repository at this point in the history
<!-- Thanks for submitting a PR! Please ensure the following
requirements are met in order for us to review your PR -->

## Checklist

* [ ] Tests written for all new code
* [ ] Linter has been satisfied
* [ ] Sign-off given on the changes (see CONTRIBUTING.md)
  • Loading branch information
Half-Shot authored Jun 13, 2024
2 parents 0ff14e9 + 34b96a7 commit ce8f9ca
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"tsconfig.json"
],
"dependencies": {
"@matrix-org/matrix-sdk-crypto-nodejs": "0.1.0-beta.11",
"@matrix-org/matrix-sdk-crypto-nodejs": "0.2.0-beta.1",
"@types/express": "^4.17.21",
"another-json": "^0.2.0",
"async-lock": "^1.4.0",
Expand Down
4 changes: 2 additions & 2 deletions test/TestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function testCryptoStores(fn: (StoreType) => Promise<void>): Promis
}

export function bindNullEngine(http: HttpBackend) {
http.when("POST", "/keys/upload").respond(200, (path, obj) => {
http.when("POST", "/_matrix/client/v3/keys/upload").respond(200, (path, obj) => {
expect(obj).toMatchObject({

});
Expand All @@ -78,7 +78,7 @@ export function bindNullEngine(http: HttpBackend) {
}

export function bindNullQuery(http: HttpBackend) {
http.when("POST", "/keys/query").respond(200, (path, obj) => {
http.when("POST", "/_matrix/client/v3/keys/query").respond(200, (path, obj) => {
return {};
});
}
Expand Down
12 changes: 6 additions & 6 deletions test/encryption/KeyBackupTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('KeyBackups', () => {
bindNullEngine(http);
await Promise.all([
client.crypto.prepare(),
http.flushAllExpected(),
http.flushAllExpected({ timeout: 5000 }),
]);
};

Expand Down Expand Up @@ -81,7 +81,7 @@ describe('KeyBackups', () => {

let keyBackupInfoOnServer: IKeyBackupInfoRetrieved|undefined;

http.when("POST", "/room_keys/version").respond(200, (path, obj: IKeyBackupInfo) => {
http.when("POST", "/_matrix/client/v3/room_keys/version").respond(200, (path, obj: IKeyBackupInfo) => {
expect(obj.auth_data.signatures[USER_ID]).toHaveProperty(`ed25519:${TEST_DEVICE_ID}`);

keyBackupInfoOnServer = {
Expand All @@ -93,7 +93,7 @@ describe('KeyBackups', () => {
return keyBackupInfoOnServer.version;
});

http.when("GET", "/room_keys/version").respond(200, (path, obj) => {
http.when("GET", "/_matrix/client/v3/room_keys/version").respond(200, (path, obj) => {
expect(keyBackupInfoOnServer).toBeDefined();
expect(keyBackupInfoOnServer.version).toBe("1");

Expand All @@ -110,7 +110,7 @@ describe('KeyBackups', () => {
})(),
http.flushAllExpected(),
]);
}));
}), 10000);

it('should fail to enable backups when the crypto has not been prepared', () => testCryptoStores(async (cryptoStoreType) => {
try {
Expand Down Expand Up @@ -179,7 +179,7 @@ describe('KeyBackups', () => {

const encryptRoomEvent = async () => {
bindNullQuery(http);
const encryptPromise = client.crypto.encryptRoomEvent(roomId, "m.room.message", "my message");
const encryptPromise = client.crypto.encryptRoomEvent(roomId, "m.room.message", { body: "my message" });
await http.flushAllExpected({ timeout: 10000 });

// This is because encryptRoomEvent calls "/keys/query" after encrypting too.
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('KeyBackups', () => {
};

const expectToPutRoomKey = () => {
http.when("PUT", "/room_keys/keys").respond(200, onBackupRequest);
http.when("PUT", "/_matrix/client/v3/room_keys/keys").respond(200, onBackupRequest);
};

expectToPutRoomKey();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -654,10 +654,10 @@
dependencies:
lodash "^4.17.21"

"@matrix-org/matrix-sdk-crypto-nodejs@0.1.0-beta.11":
version "0.1.0-beta.11"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-nodejs/-/matrix-sdk-crypto-nodejs-0.1.0-beta.11.tgz#537cd7a7bbce1d9745b812a5a7ffa9a5944e146c"
integrity sha512-z5adcQo4o0UAry4zs6JHGxbTDlYTUMKUfpOpigmso65ETBDumbeTSQCWRw8UeUV7aCAyVoHARqDTol9SrauEFA==
"@matrix-org/matrix-sdk-crypto-nodejs@0.2.0-beta.1":
version "0.2.0-beta.1"
resolved "https://registry.yarnpkg.com/@matrix-org/matrix-sdk-crypto-nodejs/-/matrix-sdk-crypto-nodejs-0.2.0-beta.1.tgz#b696707ccfa944cfed3c96cf7e54799b0f1e3329"
integrity sha512-CgbOKORfD6dvYgQTPhfN73H1RbQknrFkMnRRwCIJMt15iL2AF1gEowgbrlGhkbG6gNng4CgPnKs1iHKCRrhvmA==
dependencies:
https-proxy-agent "^5.0.1"
node-downloader-helper "^2.1.5"
Expand Down

0 comments on commit ce8f9ca

Please sign in to comment.