{"record":{"id":"7ad194b67aa386ce","repo":"RocketChat/Rocket.Chat","slug":"missing-rooms","errorCode":null,"errorMessage":"missing-rooms","messagePattern":"missing-rooms","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/services/team/service.ts","lineNumber":318,"sourceCode":"\t\tnames: Array<string>,\n\t\toptions?: FindOptions<ITeam> | FindOptions<P extends ITeam ? ITeam : P>,\n\t): Promise<P[] | ITeam[]> {\n\t\tif (options === undefined) {\n\t\t\treturn Team.findByNames(names).toArray();\n\t\t}\n\t\treturn Team.findByNames(names, options).toArray();\n\t}\n\n\tasync listByIds(ids: Array<string>, options?: FindOptions<ITeam>): Promise<ITeam[]> {\n\t\treturn Team.findByIds(ids, options).toArray();\n\t}\n\n\tasync addRooms(uid: string, rooms: Array<string>, teamId: string): Promise<Array<IRoom>> {\n\t\tif (!teamId) {\n\t\t\tthrow new Error('missing-teamId');\n\t\t}\n\t\tif (!rooms) {\n\t\t\tthrow new Error('missing-rooms');\n\t\t}\n\t\tif (!uid) {\n\t\t\tthrow new Error('missing-userId');\n\t\t}\n\n\t\tconst team = await Team.findOneById<Pick<ITeam, '_id' | 'roomId'>>(teamId, { projection: { _id: 1, roomId: 1 } });\n\t\tif (!team) {\n\t\t\tthrow new Error('invalid-team');\n\t\t}\n\n\t\t// at this point, we already checked for the permission\n\t\t// so we just need to check if the user can see the room\n\t\tconst user = await Users.findOneById(uid);\n\t\tif (!user) {\n\t\t\tthrow new Error('invalid-user');\n\t\t}\n\n\t\tconst rids = rooms.filter((rid) => rid && typeof rid === 'string');","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/e4b8178b205510181a96ceefee043d0abcd13e5a/apps/meteor/server/services/team/service.ts#L300-L336","documentation":"Error \"missing-rooms\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/services/team/service.ts:316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty array of room ids when calling TeamService.addRooms.","Verify the request payload includes the rooms field before submitting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4b8178b205510181a96ceefee043d0abcd13e5a","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}