{"record":{"id":"745e9309f820c64f","repo":"RocketChat/Rocket.Chat","slug":"error-message-not-found-745e93","errorCode":"error-message-not-found","errorMessage":"error-message-not-found","messagePattern":"error-message-not-found","errorType":"exception","errorClass":"Error","httpStatus":400,"severity":"error","filePath":"apps/meteor/server/api/v1/push.ts","lineNumber":311,"sourceCode":"\t\t\tauthRequired: true,\n\t\t\tquery: isPushGetProps,\n\t\t\tresponse: {\n\t\t\t\t200: pushGetResponseSchema,\n\t\t\t\t400: validateBadRequestErrorResponse,\n\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',","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/api/v1/push.ts#L293-L329","documentation":"Thrown by GET /api/v1/push.get when Messages.findOneById(id) returns null — the `id` query param is not an existing message _id. The endpoint exists so clients can render the push notification for a specific message, so a wrong, truncated, or already-deleted message id fails here before the room lookup runs.","triggerScenarios":"GET /api/v1/push.get?id=<messageId> with a mistyped/truncated id, a message deleted by retention or moderation before the client opened the notification, or an id from another workspace passed in.","commonSituations":"Notification tapped long after the message was pruned by retention policies; ids logged in one environment and replayed against another; message removed by a moderator while a batch notification job iterates ids.","solutions":["Only call push.get with ids that came from a live push payload or the user's own message stream","Validate the id shape first (17-char alphanumeric Rocket.Chat id)","On this error, dismiss the local notification instead of retrying — the message is gone"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const isMessageId = (id: unknown): id is string =>\n  typeof id === 'string' && /^[A-Za-z0-9]{17}$/.test(id);\nif (!isMessageId(id)) throw new Error(`malformed message id: ${JSON.stringify(id)}`);\n// only fetch push info for ids that arrived in a push payload for THIS user\nif (!pushPayloadIds.has(id)) throw new Error('message id not from a local push payload');","typeGuard":"const isRocketChatId = (v: unknown): v is string =>\n  typeof v === 'string' && /^[A-Za-z0-9]{17}$/.test(v);","tryCatchPattern":"catch 'error-message-not-found' and dismiss the local notification silently — the message was deleted (retention/moderation) and retrying cannot bring it back.","preventionTips":["Expire queued notifications after the retention window","Validate id shape before calling push.get","Don't share message ids between users' sessions — access is checked per receiver"],"tags":["push","notifications","messages","not-found","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"}