You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I want to get the event history of a room and call matrix api: "GET", /_matrix/client/v3/rooms/{roomId}/messages
After that, i need to decrypt every m.room.encrypted and use MatrixClient().crypto.decryptRoomEvent.
I got this error:
Error: Expect value to be String, but received Undefined
at CryptoClient.decryptRoomEvent (C:\Users\Alexandre\Desktop\dev\minint\bot\node_modules\matrix-bot-sdk\lib\e2ee\CryptoClient.js:195:53)
at descriptor.value (C:\Users\Alexandre\Desktop\dev\minint\bot\node_modules\matrix-bot-sdk\lib\e2ee\decorators.js:33:35)
at getRoomEvents (file:///C:/Users/Alexandre/Desktop/dev/minint/bot/dist/commands/domain/exportRoom.js:29:70)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async exportRoom (file:///C:/Users/Alexandre/Desktop/dev/minint/bot/dist/commands/domain/exportRoom.js:2:20) {
code: 'InvalidArg'
}
To Reproduce
My code:
async functiongetRoomEvents(client: MatrixClient,roomId: string): Promise<RoomEvent[]>{letevents: RoomEvent[]=[];try{letendToken=undefined;do{constresponse=awaitclient.doRequest("GET",`/_matrix/client/v3/rooms/${encodeURIComponent(roomId)}/messages`,{from: endToken,dir: "b",limit: 100});for(consteventofresponse.chunk){if(event.type==='m.room.encrypted'){constdecryptedMessage=awaitclient.crypto.decryptRoomEvent(event,roomId);event.push(decryptedMessage)}else{events.push(event);}}endToken=response.end;}while(endToken!=null);}catch(error: any){console.error(`Erreur lors de la récupération des événements :`,error);}returnevents;}
Expected behavior
Get decrypted messages event.
The text was updated successfully, but these errors were encountered:
Describe the bug
I want to get the event history of a room and call matrix api: "GET",
/_matrix/client/v3/rooms/{roomId}/messages
After that, i need to decrypt every m.room.encrypted and use MatrixClient().crypto.decryptRoomEvent.
I got this error:
Error: Expect value to be String, but received Undefined
at CryptoClient.decryptRoomEvent (C:\Users\Alexandre\Desktop\dev\minint\bot\node_modules\matrix-bot-sdk\lib\e2ee\CryptoClient.js:195:53)
at descriptor.value (C:\Users\Alexandre\Desktop\dev\minint\bot\node_modules\matrix-bot-sdk\lib\e2ee\decorators.js:33:35)
at getRoomEvents (file:///C:/Users/Alexandre/Desktop/dev/minint/bot/dist/commands/domain/exportRoom.js:29:70)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async exportRoom (file:///C:/Users/Alexandre/Desktop/dev/minint/bot/dist/commands/domain/exportRoom.js:2:20) {
code: 'InvalidArg'
}
To Reproduce
My code:
Expected behavior
Get decrypted messages event.
The text was updated successfully, but these errors were encountered: