1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-04 05:02:41 +03:00

Add some debugging & a debug event for decryption

Adds a log line whenever we save a session and also adds an event
that's fired whenever we get a to-device event we can't decrypt
(hopefully the comment explains all).
This commit is contained in:
David Baker
2023-01-13 18:24:33 +00:00
parent eb058edb1b
commit 89d2984432
3 changed files with 20 additions and 0 deletions

View File

@@ -855,6 +855,7 @@ export enum ClientEvent {
SyncUnexpectedError = "sync.unexpectedError",
ClientWellKnown = "WellKnown.client",
ReceivedVoipEvent = "received_voip_event",
UndecryptableToDeviceEvent = "toDeviceEvent.undecryptable",
TurnServers = "turnServers",
TurnServersError = "turnServers.error",
}
@@ -1063,6 +1064,18 @@ export type ClientEventHandlerMap = {
* ```
*/
[ClientEvent.ToDeviceEvent]: (event: MatrixEvent) => void;
/**
* Fires if a to-device event is received that cannot be decrypted.
* Encrypted to-device events will (generally) use plain Olm encryption,
* in which case decryption failures are fatal: the event will never be
* decryptable, unlike Megolm encrypted events where the key may simply
* arrive later.
*
* An undecryptable to-device event is therefore likley to indicate problems.
*
* @param event - The undecyptable to-device event
*/
[ClientEvent.UndecryptableToDeviceEvent]: (event: MatrixEvent) => void;
/**
* Fires whenever new user-scoped account_data is added.
* @param event - The event describing the account_data just added