-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove legacy crypto #4653
base: develop
Are you sure you want to change the base?
Remove legacy crypto #4653
Conversation
…crypto/call Remove deprecated calls in `webrtc/call.ts`
* chore(legacy call): Remove `DeviceInfo` usage * refactor(legacy call): throw `GroupCallUnknownDeviceError` at the end of `initOpponentCrypto`
* feat(legacy crypto)!: remove deprecated methods of `MatrixClient` * test(legacy crypto): update existing tests to not use legacy crypto - `Embedded.spec.ts`: casting since `encryptAndSendToDevices` is removed from `MatrixClient`. - `room.spec.ts`: remove deprecated usage of `MatrixClient.crypto` - `matrix-client.spec.ts` & `matrix-client-methods.spec.ts`: remove calls of deprecated methods of `MatrixClient` * test(legacy crypto): remove test files using `MatrixClient` deprecated methods * test(legacy crypto): update existing integ tests to run successfully * feat(legacy crypto!): remove `ICreateClientOpts.deviceToImport`. `ICreateClientOpts.deviceToImport` was used in the legacy cryto. The rust crypto doesn't support to import devices in this way. * feat(legacy crypto!): remove `{get,set}GlobalErrorOnUnknownDevices` `globalErrorOnUnknownDevices` is not used in the rust-crypto. The API is marked as unstable, we can remove it.
* feat(legacy crypto!): keep legacy methods used in lib olm migration The rust cryto needs these legacy stores in order to do the migration from the legacy crypto to the rust crypto. We keep the following methods of the stores: - Used in `libolm_migration.ts`. - Needed in the legacy store tests. - Needed in the rust crypto test migration. * feat(legacy crypto): extract legacy crypto types in legacy stores In order to be able to delete the legacy crypto, these stores shouldn't rely on the legacy crypto. We need to extract the used types. * feat(crypto store): remove `CryptoStore` functions used only by tests * test(crypto store): use legacy `MemoryStore` type
* feat(CryptoBackend)!: remove deprecated methods * feat(rust-crypto)!: remove deprecated methods of `CryptoBackend` * test(rust-crypto): remove tests of deprecated methods of `CryptoBackend`
The interface of `encryptAndSendToDevices` changes because `DeviceInfo` is from the legacy crypto. In fact `encryptAndSendToDevices` only need pairs of userId and deviceId.
* fix(legacy store): fix legacy store typing In #4663, the storeXXX methods were removed of the CryptoStore interface but they are used internally by IndexedDBCryptoStore. * feat(legacy crypto)!: remove content of `crypto/*` except legacy stores * test(legacy crypto): remove `spec/unit/crypto/*` except legacy store tests * refactor: remove unused types * doc: fix broken link * doc: remove link tag when typedoc is unable to find the CryptoApi
…-legacy-crypto # Conflicts: # src/crypto/index.ts
* test(crypto): remove `newBackendOnly` test closure * test(crypto): fix duplicate test name * test(crypto): remove `oldBackendOnly` test closure * test(crypto): remove `rust-sdk` comparison * test(crypto): remove iteration on `CRYPTO_BACKEND` * test(crypto): remove old legacy comments and tests * test(crypto): fix documentations and removed unused expect
…-legacy-crypto # Conflicts: # src/client.ts # src/crypto/EncryptionSetup.ts # src/crypto/OutgoingRoomKeyRequestManager.ts
src/@types/crypto.ts
Outdated
@@ -30,7 +30,7 @@ interface Extensible { | |||
|
|||
/* eslint-disable camelcase */ | |||
|
|||
/** The result of a call to {@link MatrixClient.exportRoomKeys} */ | |||
/** The result of a call to CryptoApi.exportRoomKeys */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it breaks docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #4672
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh perfect, I didn't understood first the documentation. I tried multiple times different without success. I'll make a PR for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also just noticed in the screenshot I included that it looks like OlmGroupSessionExtraData
is now unused that /crypto/
has been deleted so seems like the checks for dead code were not exhaustive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I relied on knip to catch the unused type, this one wasn't raised unfortunately.
* | ||
* @returns a promise that resolves when the request is queued | ||
*/ | ||
public cancelAndResendKeyRequest(crypto: Crypto, userId: string): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Event.cancelAndResendKeyRequest
is only used by
Lines 3211 to 3225 in 7d68753
/** | |
* Cancel a room key request for this event if one is ongoing and resend the | |
* request. | |
* @param event - event of which to cancel and resend the room | |
* key request. | |
* @returns A promise that will resolve when the key request is queued | |
* | |
* @deprecated Not supported for Rust Cryptography. | |
*/ | |
public cancelAndResendEventRoomKeyRequest(event: MatrixEvent): Promise<void> { | |
if (!this.crypto) { | |
throw new Error("End-to-End encryption disabled"); | |
} | |
return event.cancelAndResendKeyRequest(this.crypto, this.getUserId()!); | |
} |
Which was deprecated and deleted in this PR. Crypto
is also deprecated, this function can't live with Crypto
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but it should be deprecated before removal, just because another method with a similar name was deprecated does not mean this was deprecated.
@@ -1721,10 +1691,6 @@ export class MatrixEvent extends TypedEventEmitter<MatrixEventEmittedEvents, Mat | |||
}; | |||
} | |||
|
|||
public setVerificationRequest(request: VerificationRequest): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't deprecated?
@t3chguy the strategy we agreed was that we'd review PRs on the way into the |
Where was the list of component parts which are to be PR'd individually reviewed? What's to say all the PRs have been made now and there doesn't need to be further PRs made onto this feature branch? If we don't review this then what's to stop the component sum of all the PRs not being acceptable? |
Closes element-hq/element-web#26922
EW e2e tests
Remove the legacy crypto. All included PRs have been reviewed.
Sonarcloud is raising an issue because the code coverage on new code is at 71.4% due to the lack of code coverage on the legacy call. I'll ask an exception to merge this PR (EW e2e tests are OK).
webrtc/call.ts
#4562DeviceInfo
inwebrtc/call.ts
#4654MatrixClient.initLegacyCrypto
#4620sync
api #4622MatrixClient
#4659event.ts
#4666embedded.ts
#4668CryptoBackend
#4671matrix.ts
#4667CryptoApi
#4692