1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-23 17:02:25 +03:00

Grab bag of Element-R cleanups (#3773)

* `RustBackupManager.getActiveBackupVersion`: check that backup is enabled

The previous check on `isBackupEnabled` was a no-op

* Fix log spam on shieldless events

* Reduce log spam about tracking users

* Reduce log spam about decrypting events

Logging the entire event is excessive
This commit is contained in:
Richard van der Hoff
2023-10-04 10:15:54 +01:00
committed by GitHub
parent 6e8d15e5ed
commit 10b6c2463d
4 changed files with 11 additions and 13 deletions

View File

@@ -1223,10 +1223,6 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, RustCryptoEv
// start tracking devices for any users already known to be in this room.
const members = await room.getEncryptionTargetMembers();
logger.debug(
`[${room.roomId} encryption] starting to track devices for: `,
members.map((u) => `${u.userId} (${u.membership})`),
);
await this.olmMachine.updateTrackedUsers(members.map((u) => new RustSdkCryptoJs.UserId(u.userId)));
}
@@ -1518,7 +1514,10 @@ class EventDecryptor {
public constructor(private readonly olmMachine: RustSdkCryptoJs.OlmMachine, private readonly crypto: RustCrypto) {}
public async attemptEventDecryption(event: MatrixEvent): Promise<IEventDecryptionResult> {
logger.info("Attempting decryption of event", event);
logger.info(
`Attempting decryption of event ${event.getId()} in ${event.getRoomId()} from ${event.getSender()}`,
);
// add the event to the pending list *before* attempting to decrypt.
// then, if the key turns up while decryption is in progress (and
// decryption fails), we will schedule a retry.
@@ -1691,7 +1690,7 @@ function rustEncryptionInfoToJsEncryptionInfo(
}
let shieldReason: EventShieldReason | null;
if (shieldState.message === null) {
if (shieldState.message === undefined) {
shieldReason = null;
} else if (shieldState.message === "Encrypted by an unverified user.") {
// this case isn't actually used with lax shield semantics.