@@ -35,7 +35,7 @@ import { type IHttpOpts, type MatrixHttpApi, Method } from "../http-api/index.ts
3535import { RoomEncryptor } from "./RoomEncryptor.ts" ;
3636import { OutgoingRequestProcessor } from "./OutgoingRequestProcessor.ts" ;
3737import { KeyClaimManager } from "./KeyClaimManager.ts" ;
38- import { logDuration , MapWithDefault } from "../utils.ts" ;
38+ import { MapWithDefault } from "../utils.ts" ;
3939import {
4040 type BackupTrustInfo ,
4141 type BootstrapCrossSigningOpts ,
@@ -1494,17 +1494,14 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
14941494 unusedFallbackKeys ?: Set < string > ;
14951495 devices ?: RustSdkCryptoJs . DeviceLists ;
14961496 } ) : Promise < IToDeviceEvent [ ] > {
1497- const result = await logDuration ( logger , "receiveSyncChanges" , async ( ) => {
1498- return await this . olmMachine . receiveSyncChanges (
1499- events ? JSON . stringify ( events ) : "[]" ,
1500- devices ,
1501- oneTimeKeysCounts ,
1502- unusedFallbackKeys ,
1503- ) ;
1504- } ) ;
1497+ const result = await this . olmMachine . receiveSyncChanges (
1498+ events ? JSON . stringify ( events ) : "[]" ,
1499+ devices ,
1500+ oneTimeKeysCounts ,
1501+ unusedFallbackKeys ,
1502+ ) ;
15051503
1506- // receiveSyncChanges returns a JSON-encoded list of decrypted to-device messages.
1507- return JSON . parse ( result ) ;
1504+ return result . map ( ( processed ) => JSON . parse ( processed . rawEvent ) ) ;
15081505 }
15091506
15101507 /** called by the sync loop to preprocess incoming to-device messages
0 commit comments