The megolm tests were making a few assumptions which they really shouldn't; in
particular:
* They were creating mock events with event_ids not starting `$`, and lacking
`sender`, `origin_server_ts` and `unsigned` properties
* They were not including the (now) required `keys.ed25519` property inside
the ciphertext of an olm message.
These work ok currently, but they aren't really correct, and they cause
problems when testing the new rust implementation.
* Use a PrefixedLogger throughout `megolm.ts`
Rather than manually adding `in ${this.roomId}` to each log line, use a
PrefixedLogger to achieve the same effect more consistently.
* Clean up logging in megolm.ts
Where we log a list of devices, we don't need the whole deviceinfo, just the
device id. All that noise makes it very hard to read the logs.
* Log users that we find in the room when encrypting
* Reduce log verbosity on decryption retries
* Remove extensible events v1 field population on legacy events
With extensible events v2, affected events are now gated by a room version, so we don't need this code anymore.
The proposal has generally moved away from mixing m.room.message with extensible fields as well.
* Run prettier
* Remove unstable identifier from tests too
* Run prettier again
It turns out that MatrixClient uses a `FetchHttpApi` instance with
`opts.onlyData = true`, so it was returning the json-parsed response rather
than the raw response. Change the way we call `authedRequest` so that we get
the raw body back.
I need to start calling back into the new rust crypto implementation from the /sync loops, so I need to pass it into SyncApi. To reduce the coupling, I've defined a new interface specifying the methods which exist for that purpose. Currently it's only onSyncCompleted.
There are a couple of callback interfaces which are currently stuffed into
`IStoredClientOpts` to make it easier to pass them into the `SyncApi`
constructor.
Before we add more fields to this, let's separate it out to a separate object.
`Room` and `Crypto` currently have some tight coupling in the form of a call to
`trackRoomDevices` when out-of-band members are loaded. We can improve this by
instead having Crypto listen out for a `RoomSateEvent.Update` notification.
This PR introduces MatrixClient.initRustCrypto, which is similar to initCrypto, except that it will use the Rust crypto SDK instead of the old libolm-based implementation.
This is very much not something you want to use in production code right now, because the integration with the rust sdk is extremely skeletal and almost everything crypto-related will raise an exception rather than doing anything useful.
It is, however, enough to demonstrate the loading of the wasmified rust sdk in element web, and a react sdk with light modifications can successfully log in and out.
Part of vector-im/element-web#21972.
* add deleteAccountData endpoint
* check server support and test
* test current state of memorystore
* interpret account data events with empty content as deleted
* add handling for (future) stable version of endpoint
* add getSafeUserId
* user getSafeUserId in deleteAccountData
* better jsdoc for throws documentation