The code to migrate from the `sessionStore` to `cryptoStore` originally appeared
in https://github.com/matrix-org/matrix-js-sdk/pull/584 (2017-12-06). At this
point, it seems safe to assume most sessions that need migrating have already
done so. Removing this code simplifies store handling and removes the
`sessionStore` from most places in JS SDK.
use sendRoomKeyRequest with a new resend flag, instead of cancelRoomKeyRequest,
when requesting keys, so that we make sure that we send a new request if there
is no previous request
fixes https://github.com/vector-im/riot-web/issues/6838
Contributing: Note that rebase lets you mass signoff commits
replace find loop + slice with a single filter. More readable
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
keep public APIs consistent with previous behaviour now that its fuzzy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
make tests not fail, because of order of occurrence
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
do falsey displayname check regardless of whether we have roomstate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
add tests for the fuzzy disambiguation between members in a room
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
remove duplicated call
Standardize on importing `olm-loader` rather than pasting the same boilerplate
in different tests. Importantly, `spec/unit/crypto.spec.js` did not include any
loading approach, so it would only find Olm if some other test loaded it first.
Signed-off-by: J. Ryan Stinnett <jryans@gmail.com>
* Support .well-known autodiscovery in the js-sdk
It's much more useful here than in the react-sdk as it can be reused by more applications. This is also required to make the react-sdk a little easier to manage .well-known lookups as soon it'll be doing it in several places.
Automatic discovery is an abstract concept in the spec and could include more than .well-known in the future, so this is made to be generic enough to support future mechanisms and other resources to discover. There's also a ton of comments (more than normally needed) as people may wish to use this as a reference in their own implementation and it doesn't hurt to explain what everything is doing.
Many of the functions are air lifted from the react-sdk and modified to work within the confines of the js-sdk.
* Swap out uglify-js for uglify-es
So we can start using ES6 dependencies without figuring out how to update babel.
`uglify-es` is compatible with `uglify-js@3` (we were using `@2`) , which is why the same command is used. This commit includes changes to the command line to make the thing run the same as before too.
* Appease the linter
* Appease the linter some more
* Appease the linter: the tiebreaker
* Appease the linter yet again
* Switch to using the already available URL libraries
* Remove excess logging
* Start a new Olm sessions with a device when we get an undecryptable
message on it.
* Send a dummy message on that sessions such that the other end knows
about it.
* Re-send any outstanding keyshare requests for that device.
Also includes a unit test for megolm that isn't very related but came
out as a result anyway.
Includes https://github.com/matrix-org/matrix-js-sdk/pull/776
Fixes https://github.com/vector-im/riot-web/issues/3822