From b40cf75c9de6178ac84796e242009b246f911656 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Mon, 14 Nov 2022 10:01:05 +0000 Subject: [PATCH] Remove `Crypto.start()` (#2871) This isn't really needed, and its semantics are poorly defined. (Contrary to the comment, it dos *not* set background processes running). --- spec/unit/crypto.spec.ts | 18 ++++++++++++++++++ src/client.ts | 1 - src/crypto/OutgoingRoomKeyRequestManager.ts | 9 +-------- src/crypto/index.ts | 6 ++++-- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/spec/unit/crypto.spec.ts b/spec/unit/crypto.spec.ts index 333868c78..e8a95370c 100644 --- a/spec/unit/crypto.spec.ts +++ b/spec/unit/crypto.spec.ts @@ -1122,4 +1122,22 @@ describe("Crypto", function() { expect(free).toHaveBeenCalled(); }); }); + + describe("start", () => { + let client: TestClient; + + beforeEach(async () => { + client = new TestClient("@alice:example.org", "aliceweb"); + await client.client.initCrypto(); + }); + + afterEach(async function() { + await client!.stop(); + }); + + // start() is a no-op nowadays, so there's not much to test here. + it("should complete successfully", async () => { + await client!.client.crypto!.start(); + }); + }); }); diff --git a/src/client.ts b/src/client.ts index 316e554c0..9b545540e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1200,7 +1200,6 @@ export class MatrixClient extends TypedEventEmitter