{"record":{"id":"4b145f58ea8420f3","repo":"RocketChat/Rocket.Chat","slug":"room-roomdata-id-not-found","errorCode":null,"errorMessage":"Room ${roomData._id} not found","messagePattern":"Room (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/app/apps/server/bridges/listeners.ts","lineNumber":513,"sourceCode":"\t\t\t}\n\n\t\t\tcase AppInterface.IPostLivechatDepartmentRemoved: {\n\t\t\t\tconst [departmentData] = args.payload;\n\t\t\t\tconst department = await this.orch.getConverters().get('departments').convertDepartment(departmentData);\n\n\t\t\t\tif (!department) {\n\t\t\t\t\tthrow new Error(`Department ${departmentData._id} not found`);\n\t\t\t\t}\n\n\t\t\t\treturn this.orch.getManager().getListenerManager().executeListener(args.event, { department });\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tconst [roomData] = args.payload;\n\t\t\t\tconst room = await this.orch.getConverters().get('rooms').convertRoom(roomData);\n\n\t\t\t\tif (!room) {\n\t\t\t\t\tthrow new Error(`Room ${roomData._id} not found`);\n\t\t\t\t}\n\n\t\t\t\tif (!isLivechatRoom(room)) {\n\t\t\t\t\tthrow new Error(`Room ${roomData._id} is not a livechat room`);\n\t\t\t\t}\n\n\t\t\t\treturn this.orch.getManager().getListenerManager().executeListener(args.event, room);\n\t\t}\n\t}\n\n\tasync userEvent(args: HandleUserEvent): Promise<unknown> {\n\t\tswitch (args.event) {\n\t\t\tcase AppInterface.IPostUserLoggedIn:\n\t\t\tcase AppInterface.IPostUserLoggedOut: {\n\t\t\t\tconst [loggedInUser] = args.payload;\n\t\t\t\tconst context = this.orch.getConverters().get('users').convertToApp(loggedInUser);\n\t\t\t\treturn this.orch.getManager().getListenerManager().executeListener(args.event, context);\n\t\t\t}","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/app/apps/server/bridges/listeners.ts#L495-L531","documentation":"Error \"Room ${roomData._id} not found\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/app/apps/server/bridges/listeners.ts:513 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the room id in the event payload refers to an existing room that the rooms converter can resolve.","Ensure the room still exists in the database before the livechat listener executes."],"exampleFix":"Fetch the room and guard against null: const room = await Rooms.findOneById(roomData._id); if (!room) { throw new Error(`Room ${roomData._id} not found`); }","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}