{"record":{"id":"86dfab2e5f1a0382","repo":"RocketChat/Rocket.Chat","slug":"error-room-not-found-86dfab","errorCode":"error-room-not-found","errorMessage":"error-room-not-found","messagePattern":"error-room-not-found","errorType":"exception","errorClass":"Error","httpStatus":400,"severity":"error","filePath":"apps/meteor/server/api/v1/push.ts","lineNumber":316,"sourceCode":"\t\t\t\t401: validateUnauthorizedErrorResponse,\n\t\t\t},\n\t\t},\n\t\tasync function action() {\n\t\t\tconst { id } = this.queryParams;\n\n\t\t\tconst receiver = await Users.findOneById(this.userId);\n\t\t\tif (!receiver) {\n\t\t\t\tthrow new Error('error-user-not-found');\n\t\t\t}\n\n\t\t\tconst message = await Messages.findOneById(id);\n\t\t\tif (!message) {\n\t\t\t\tthrow new Error('error-message-not-found');\n\t\t\t}\n\n\t\t\tconst room = await Rooms.findOneById(message.rid);\n\t\t\tif (!room) {\n\t\t\t\tthrow new Error('error-room-not-found');\n\t\t\t}\n\n\t\t\tif (!(await canAccessRoomAsync(room, receiver))) {\n\t\t\t\tthrow new Error('error-not-allowed');\n\t\t\t}\n\n\t\t\tconst data = await PushNotification.getNotificationForMessageId({ receiver, room, message });\n\n\t\t\treturn API.v1.success({ data });\n\t\t},\n\t)\n\t.get(\n\t\t'push.info',\n\t\t{\n\t\t\tauthRequired: true,\n\t\t\tresponse: {\n\t\t\t\t200: pushInfoResponseSchema,\n\t\t\t\t401: validateUnauthorizedErrorResponse,","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/api/v1/push.ts#L298-L334","documentation":"Thrown by GET /api/v1/push.get when the message exists but Rooms.findOneById(message.rid) returns null — the room the message belongs to no longer exists. This is a data-inconsistency case (or the room was deleted while its messages survived in a trash/retention window): normally deleting a room removes its messages, so hitting this error usually means deletion happened between the two lookups or a partial cleanup occurred.","triggerScenarios":"GET /api/v1/push.get?id=<messageId> where the room was deleted (admin purge, retention job) after the message row was selected; database restored inconsistently; message untrash'd without its room.","commonSituations":"Retention jobs pruning rooms while queued push notifications still reference their messages; admin room deletions racing notification opens; backup/restore mismatches in dev environments.","solutions":["Don't retry — the room is gone; drop the notification from the client's queue","If this fires repeatedly, audit for a partial deletion (messages collection rows whose rid has no room) and clean them","Stagger retention jobs vs push delivery windows if the race is systemic"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch 'error-room-not-found' and drop the notification plus any cached messages for that rid; if it recurs across many messages, escalate as a data-integrity issue (orphaned messages) rather than a client error.","preventionTips":["Assume room deletion invalidates all its queued pushes","Monitor for orphaned message rows (rid with no room) after bulk deletions/restores","Avoid replaying old notification queues after long offline periods"],"tags":["push","notifications","rooms","data-integrity","rest-api"],"backgroundTag":"resource-not-found","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"}