Skip to content
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

Merged

Conversation

* Remove `MatrixClient.initLegacyCrypto`

* Remove `MatrixClient.initLegacyCrypto` in README.md

* Remove tests using `MatrixClient.initLegacyCrypto`
* 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!): remove legacy crypto usage in `event.ts`

* test(legacy crypto): update event.spec.ts to not use legacy crypto types
* feat(legacy crypto!): remove legacy crypto export in `matrix.ts`

* test(legacy crypto): update `megolm-backup.spec.ts` to import directly `CryptoApi`
@t3chguy
Copy link
Member

t3chguy commented Feb 5, 2025

@t3chguy the strategy we agreed was that we'd review PRs on the way into the florianduros/rip-out-legacy-crypto/remove-legacy-crypto branch rather than attempt to give meaningful review to the branch as a whole. I don't think we should put another set of roadblocks on merging this branch now.

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?

florianduros and others added 3 commits February 5, 2025 14:18
…-legacy-crypto

# Conflicts:
#	spec/TestClient.ts
#	spec/integ/crypto/cross-signing.spec.ts
#	spec/integ/crypto/crypto.spec.ts
#	spec/integ/crypto/megolm-backup.spec.ts
#	spec/integ/crypto/olm-encryption-spec.ts
#	spec/integ/crypto/to-device-messages.spec.ts
#	spec/integ/crypto/verification.spec.ts
#	spec/integ/matrix-client-methods.spec.ts
#	spec/integ/matrix-client-syncing.spec.ts
#	spec/unit/crypto.spec.ts
#	spec/unit/crypto/DeviceList.spec.ts
#	spec/unit/crypto/algorithms/megolm.spec.ts
#	spec/unit/crypto/algorithms/olm.spec.ts
#	spec/unit/crypto/backup.spec.ts
#	spec/unit/crypto/cross-signing.spec.ts
#	spec/unit/crypto/crypto-utils.ts
#	spec/unit/crypto/outgoing-room-key-requests.spec.ts
#	spec/unit/crypto/secrets.spec.ts
#	spec/unit/crypto/verification/InRoomChannel.spec.ts
#	spec/unit/crypto/verification/sas.spec.ts
#	spec/unit/crypto/verification/secret_request.spec.ts
#	spec/unit/crypto/verification/util.ts
#	spec/unit/crypto/verification/verification_request.spec.ts
#	spec/unit/embedded.spec.ts
#	spec/unit/matrix-client.spec.ts
#	spec/unit/models/event.spec.ts
#	spec/unit/room.spec.ts
#	src/client.ts
#	src/common-crypto/CryptoBackend.ts
#	src/crypto/CrossSigning.ts
#	src/crypto/DeviceList.ts
#	src/crypto/EncryptionSetup.ts
#	src/crypto/OlmDevice.ts
#	src/crypto/OutgoingRoomKeyRequestManager.ts
#	src/crypto/RoomList.ts
#	src/crypto/SecretSharing.ts
#	src/crypto/SecretStorage.ts
#	src/crypto/algorithms/base.ts
#	src/crypto/algorithms/megolm.ts
#	src/crypto/algorithms/olm.ts
#	src/crypto/api.ts
#	src/crypto/backup.ts
#	src/crypto/dehydration.ts
#	src/crypto/device-converter.ts
#	src/crypto/deviceinfo.ts
#	src/crypto/index.ts
#	src/crypto/keybackup.ts
#	src/crypto/olmlib.ts
#	src/crypto/store/base.ts
#	src/crypto/store/indexeddb-crypto-store-backend.ts
#	src/crypto/store/indexeddb-crypto-store.ts
#	src/crypto/store/localStorage-crypto-store.ts
#	src/crypto/store/memory-crypto-store.ts
#	src/crypto/verification/Base.ts
#	src/crypto/verification/IllegalMethod.ts
#	src/crypto/verification/QRCode.ts
#	src/crypto/verification/SAS.ts
#	src/crypto/verification/request/Channel.ts
#	src/crypto/verification/request/InRoomChannel.ts
#	src/crypto/verification/request/ToDeviceChannel.ts
#	src/crypto/verification/request/VerificationRequest.ts
#	src/embedded.ts
#	src/models/event.ts
#	src/sync.ts
* chore(crypto): remove unused types

* doc(crypto): add missing link
…-legacy-crypto

# Conflicts:
#	src/models/event.ts
@florianduros
Copy link
Contributor Author

@t3chguy I added a test to reach the expected test coverage. #4697 has deprecated the missing method/attribute of model/events and has been back-ported.

@florianduros florianduros requested a review from t3chguy February 6, 2025 15:07
@florianduros florianduros added this pull request to the merge queue Feb 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 6, 2025
@florianduros florianduros added this pull request to the merge queue Feb 7, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 7, 2025
@florianduros florianduros added this pull request to the merge queue Feb 7, 2025
Merged via the queue into develop with commit 810f714 Feb 7, 2025
34 checks passed
@florianduros florianduros deleted the florianduros/rip-out-legacy-crypto/remove-legacy-crypto branch February 7, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rip out legacy crypto code Consider not duplicating the crypto API on MatrixClient
6 participants