`matrix-sdk-crypto-nodejs` and `matrix-sdk-crypto-js` are no longer
default members of the Cargo virtual workspace. The Github Actions
workflows for the bindings now live in a `bindings_ci.yml` files
(ideally, it should be in a subdirectory,
`.github/workflows/bindings/ci.yml` but it doesn't work).
> [`cargo-nextest`](https://nexte.st/index.html) is a next-generation
> test runner for Rust projects.
This patch installs and uses `nextest` to run our own tests.
Comparing `cargo test` and `cargo nextest` with hyperfine provides the
following results:
```sh
$ hyperfine 'cargo test --workspace' 'cargo nextest run --workspace && cargo test --doc'
Benchmark 1: cargo test --workspace
Time (mean ± σ): 51.785 s ± 2.066 s [User: 183.471 s, System: 10.563 s]
Range (min … max): 49.151 s … 56.641 s 10 runs
Benchmark 2: cargo nextest run --workspace && cargo test --doc
Time (mean ± σ): 44.556 s ± 0.894 s [User: 192.213 s, System: 11.441 s]
Range (min … max): 43.170 s … 45.762 s 10 runs
```
Benchmark 2 is 1.16 times faster than Benchmark 1.
We now support only “current”, “active” or “maintenance” versions
according to https://nodejs.org/en/about/releases/, which are
compatible with NAPI v6.
There is a segfault with `napi-rs` and Node.js in v12.17. It's an old
version, it may be fair to drop its support for now. Let's see if
people would need it in the future, we may work on `napi-rs` to fix
this bug in case it's really necessary.
This patch adds the `store_path` and the `store_passphrase` arguments
to the `OlmMachine` constructor to use a `CryptoStore` instead of
having an in-memory Olm machine.
Don't assume virtual client membership is join if none is stored, since
that leads to a client being told it's joined in rooms it has no
membership of. The main appservice client still assumes it's joined
every room it receives transaction events about.
The spec claims that we should cancel verifications if multiple
verifications are attempted at once[1]:
When the same device attempts to initiate multiple verification
attempts, the recipient should cancel all attempts with that device.
So let's start doing this.
[1]: https://spec.matrix.org/v1.2/client-server-api/#error-and-exception-handling