Currently the crypto-api hierarchy is exposed only as a `Crypto` namespace
under the "matrix" entrypoint in the documentation.
This isn't really right: it's meant to be a separate entrypoint (in the same
way as `types`, `testing` and `utils` are). This PR fixes that problem.
* Introduce Membership TS type
* Adapt the Membership TS type to be an enum
* Add docstrings for KnownMembership and Membership
* Move Membership types into a separate file, exported from types.ts
---------
Co-authored-by: Stanislav Demydiuk <s.demydiuk@gmail.com>
* fix IndexedDBStore API documentation
changes the changelog entry to include since when this change is needed
fix#3986
Signed-off-by: Jan Jurzitza <gh@webfreak.org>
* retroactively add breaking change note to changelog entry
Signed-off-by: Jan Jurzitza <gh@webfreak.org>
---------
Signed-off-by: Jan Jurzitza <gh@webfreak.org>
* Fix issue
* Fix jest test
* Fix even more jest failures
* Fix formatting
* Add a test
* Write test for older code
* Fix lint
* Rename method
* Make ctor deprecated
The only implementation of this is an async function, but I can’t await it because the interface hides the return type.
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
I’m trying to shutdown my matrix clients while using an indexdb, but awaiting the save() function has no effect because a previous sync was in flight. I ended up deleting the matrix client while the save was in flight and I saw a crash.
signed-off-by Austin Ellis <austin@hntlabs.com>
fix linter
* 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
this should hopefully reduce chances of
https://github.com/vector-im/element-web/issues/21541 a bit more
as we were incorrectly loading the sync accumulator even
if a sync persist was already in flight, thus wasting RAM
and increasing the chance of the renderer process OOMing
* Retry to-device messages
This adds a queueToDevice API alongside sendToDevice which is a
much higher-level API that adds the messages to a queue, stored in
persistent storage, and retries them periodically. Also converts
sending of megolm keys to use the new API.
Other uses of sendToDevice are nopt converted in this PR, but could
be later.
Requires https://github.com/matrix-org/matrix-mock-request/pull/17
* Bump matrix-mock-request
* Add more waits to make indexeddb tests pass
* Switch some test expectations to queueToDevice
* Stop straight away if the client has been stopped
Hopefully will fix tests being flakey and logging after tests have
finished.
* Add return types & fix constant usage
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Fix return type
Co-authored-by: Germain <germains@element.io>
* Stop the client in all test cases
Co-authored-by: Germain <germains@element.io>
add a flag to stop the sync worker trying to persist to indexeddb
if there are already persists in flight. accumulates user presence
updates in RAM to stop them being lost if the persist is skipped.
hopefully fixes https://github.com/vector-im/element-web/issues/21541
* More sonar tweaks and typing improvements
* delint
* Write some tests
* Attempt to make TS happy
* Stash tests
* Add tests
* Add `istanbul ignore if` around logging special-case for test env
* Add test
* Comments
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This API is due for removal in Synapse and has been deprecated for a very long time. People should move away from it soon, but just in case we'll declare this as a breaking change.
There is no impact on sync storage here: we happen to store the data in a way that is backwards-compatible for group-supporting clients, and the code guards against missing data from the stores. So, if someone were to revert, they'd be "safe" (probably lose all their group info, but the app wouldn't crash).