-
-
Notifications
You must be signed in to change notification settings - Fork 592
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
Update matrix-sdk-crypto-wasm to 11.0.0 #4566
base: develop
Are you sure you want to change the base?
Conversation
195c57f
to
6dc5cf8
Compare
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.
Thanks, tough work.
@@ -990,6 +992,31 @@ describe.each(Object.entries(CRYPTO_BACKENDS))("verification (%s)", (backend: st | |||
aliceClient.setGlobalErrorOnUnknownDevices(false); | |||
syncResponder.sendOrQueueSyncResponse(getSyncResponse([BOB_TEST_USER_ID])); | |||
await syncPromise(aliceClient); | |||
const crypto = aliceClient.getCrypto()!; | |||
if (crypto instanceof RustCrypto) { |
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 really don't like that we're using instanceof
for this - apart from breaking OO paradigms, it has a tendency to break in unpredictable ways if your modules get messed up and you end up with two different RustCrypto
classes. If the app really needs to know what it is, an isRustCrypto()
? Or implNeedsSenderDeviceKeys()
(although maybe that's even worse).
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.
The right solution here is probably a test on backend
, as per https://github.com/uhoreg/matrix-js-sdk/blob/crypto-wasm-11/spec/integ/crypto/verification.spec.ts#L125
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.
Yes, I originally tested it using backend
, but then TypeScript would complain because I'm calling functions that are only defined for RustCrypto
(onSyncCompleted
and preprocessToDeviceMessages
)
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.
ah, of course. I guess cast it... or test for the existence of those functions?
Checklist
public
/exported
symbols have accurate TSDoc documentation.