{"record":{"id":"4d2678ab4d0be5c8","repo":"RocketChat/Rocket.Chat","slug":"integration-called-without-owner-data","errorCode":null,"errorMessage":"Integration called without owner data","messagePattern":"Integration called without owner data","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/lib/integrations/lib/triggerHandler.ts","lineNumber":321,"sourceCode":"\t\t\t\tdata.timestamp = message.ts;\n\t\t\t\tdata.user_id = message.u._id;\n\t\t\t\tdata.user_name = message.u.username;\n\t\t\t\tdata.text = message.msg;\n\t\t\t\tdata.user = userWithoutServicesField;\n\t\t\t\tdata.room = room;\n\t\t\t\tdata.message = message;\n\n\t\t\t\tif (message.alias) {\n\t\t\t\t\tdata.alias = message.alias;\n\t\t\t\t}\n\n\t\t\t\tif (message.bot) {\n\t\t\t\t\tdata.bot = Boolean(message.bot); // TODO: need to double check this, since it makes no sense\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'roomCreated':\n\t\t\t\tif (!owner) {\n\t\t\t\t\toutgoingLogger.warn({ msg: 'Integration called without owner data', event });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata.channel_id = room._id;\n\t\t\t\tdata.channel_name = room.name;\n\t\t\t\tdata.timestamp = room.ts;\n\t\t\t\tdata.user_id = owner._id;\n\t\t\t\tdata.user_name = owner.username;\n\t\t\t\tdata.owner = ownerWithoutServicesField;\n\t\t\t\tdata.room = room;\n\t\t\t\tbreak;\n\t\t\tcase 'roomArchived':\n\t\t\tcase 'roomJoined':\n\t\t\tcase 'roomLeft':\n\t\t\t\tif (!user) {\n\t\t\t\t\toutgoingLogger.warn({ msg: 'Integration called without owner data', event });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdata.timestamp = new Date();","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/integrations/lib/triggerHandler.ts#L303-L339","documentation":"Intended guard for the roomCreated event: mapEventArgsToData builds the webhook payload from the room owner (user_id, user_name, owner object), and warns then skips the POST when owner is missing. Note that the earlier !room || !message guard in the same function usually fires first for roomCreated, because that event never carries a message (see error 1954).","triggerScenarios":"executeTriggers invoked for roomCreated with fewer than the expected three arguments (event, owner, room), leaving argObject.owner undefined - e.g. custom emission code with wrong arity.","commonSituations":"Custom forks emitting roomCreated with missing or mis-ordered arguments; refactors that changed the emission signature without updating this consumer.","solutions":["Emit roomCreated with its full signature: (event, owner, room)","Check the debug line 'Got the event arguments for the event' - a missing userId indicates the owner did not arrive","For dependable webhooks use sendMessage events, which carry full context","Patch the upstream guards in a fork if roomCreated deliveries are a hard requirement"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Defensive emission: only fire when the payload is complete\nif (event === 'roomCreated' && owner && room) {\n  executeTriggers('roomCreated', owner, room);\n}","typeGuard":"const hasOwner = (args: { owner?: IUser }): args is { owner: IUser } => !!args.owner;","tryCatchPattern":null,"preventionTips":["Keep emission argument order stable and covered by tests - it is an internal API contract","Log before emitting so missing context is visible at the source"],"tags":["integrations","outgoing-webhook","room-created","owner"],"backgroundTag":"missing-event-payload","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}