{"record":{"id":"293920c20463efc7","repo":"RocketChat/Rocket.Chat","slug":"visitor-with-id-visitorid-not-found","errorCode":null,"errorMessage":"Visitor with id ${visitorId} not found","messagePattern":"Visitor with id (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/app/apps/server/bridges/listeners.ts","lineNumber":466,"sourceCode":"\t\t\t\t}\n\n\t\t\t\treturn this.orch\n\t\t\t\t\t.getManager()\n\t\t\t\t\t.getListenerManager()\n\t\t\t\t\t.executeListener(args.event, {\n\t\t\t\t\t\troom,\n\t\t\t\t\t\tfrom: from as NonNullable<typeof from>, // type definition in the apps-engine seems to be incorrect\n\t\t\t\t\t\tto,\n\t\t\t\t\t\ttype: transferData.type,\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\tcase AppInterface.IPostLivechatGuestSaved: {\n\t\t\t\tconst [visitorId] = args.payload;\n\t\t\t\tconst visitor = await this.orch.getConverters().get('visitors').convertById(visitorId);\n\n\t\t\t\tif (!visitor) {\n\t\t\t\t\tthrow new Error(`Visitor with id ${visitorId} not found`);\n\t\t\t\t}\n\n\t\t\t\treturn this.orch.getManager().getListenerManager().executeListener(args.event, visitor);\n\t\t\t}\n\n\t\t\tcase AppInterface.IPostLivechatRoomSaved: {\n\t\t\t\tconst [roomId] = args.payload;\n\t\t\t\tconst room = await this.orch.getConverters().get('rooms').convertById(roomId);\n\n\t\t\t\tif (!room) {\n\t\t\t\t\tthrow new Error(`Room with id ${roomId} not found`);\n\t\t\t\t}\n\n\t\t\t\treturn this.orch\n\t\t\t\t\t.getManager()\n\t\t\t\t\t.getListenerManager()\n\t\t\t\t\t.executeListener(args.event, room as IAppsLivechatRoom);\n\t\t\t}","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/app/apps/server/bridges/listeners.ts#L448-L484","documentation":"Error \"Visitor with id ${visitorId} not found\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/app/apps/server/bridges/listeners.ts:466 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the visitorId passed in the IPostLivechatGuestSaved event payload refers to an existing livechat visitor in the database.","Ensure the visitor was not deleted between the event being fired and the listener executing; re-register the visitor if needed."],"exampleFix":"Verify the visitorId exists before calling: const visitor = await LivechatVisitors.findOneById(visitorId); if (!visitor) { throw new Error(`Visitor with id ${visitorId} 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"}