Wrap room.writeSync and co in an async log wrap to preserve context
This commit is contained in:
parent
21f510e754
commit
131d255180
1 changed files with 53 additions and 51 deletions
|
@ -411,6 +411,7 @@ export class Sync3 {
|
|||
// session.prepareSync // E2EE decrypts room keys
|
||||
// this.session.writeSync() // write account data, device lists, etc.
|
||||
await Promise.all(updates.map(async (roomResponse) => {
|
||||
await log.wrap("room", async () => {
|
||||
// get or create a room
|
||||
let room = this.session.rooms.get(roomResponse.room_id);
|
||||
if (!room) {
|
||||
|
@ -463,6 +464,7 @@ export class Sync3 {
|
|||
room: room,
|
||||
changes: changes,
|
||||
});
|
||||
})
|
||||
}))
|
||||
} catch (err) {
|
||||
// avoid corrupting state by only
|
||||
|
|
Reference in a new issue