{"record":{"id":"93f39eb6561771ab","repo":"RocketChat/Rocket.Chat","slug":"error-emoji-param-not-provided","errorCode":"error-emoji-param-not-provided","errorMessage":"The required \"emoji\" param is missing.","messagePattern":"The required \"emoji\" param is missing\\.","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/api/v1/chat.ts","lineNumber":553,"sourceCode":"\t\t\t\t\t},\n\t\t\t\t\trequired: ['success'],\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t}),\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 msg = await Messages.findOneById(this.bodyParams.messageId);\n\n\t\t\tif (!msg) {\n\t\t\t\tthrow new Meteor.Error('error-message-not-found', 'The provided \"messageId\" does not match any existing message.');\n\t\t\t}\n\n\t\t\tconst emoji = 'emoji' in this.bodyParams ? this.bodyParams.emoji : (this.bodyParams as { reaction: string }).reaction;\n\n\t\t\tif (!emoji) {\n\t\t\t\tthrow new Meteor.Error('error-emoji-param-not-provided', 'The required \"emoji\" param is missing.');\n\t\t\t}\n\n\t\t\tawait executeSetReaction(this.userId, emoji, msg, this.bodyParams.shouldReact);\n\n\t\t\treturn API.v1.success();\n\t\t},\n\t)\n\t.post(\n\t\t'chat.reportMessage',\n\t\t{\n\t\t\tauthRequired: true,\n\t\t\tbody: isChatReportMessageProps,\n\t\t\tresponse: {\n\t\t\t\t200: ajv.compile<void>({\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tsuccess: {\n\t\t\t\t\t\t\ttype: 'boolean',","sourceCodeStart":535,"sourceCodeEnd":571,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/chat.ts#L535-L571","documentation":"Thrown by POST chat.react when neither 'emoji' nor the legacy 'reaction' field yields a truthy value. The route body schema (isChatReactProps, a oneOf) already requires either emoji or reaction, so under normal AJV validation this branch is defensive belt-and-suspenders. It can still fire if the schema validator is bypassed or if both fields are empty strings that passed a looser path.","triggerScenarios":"POST /api/v1/chat.react with { messageId, emoji: '' } or { messageId, reaction: '' }; or a caller that sends { messageId } only on a deployment where the body schema did not run (older server, or a custom middleware).","commonSituations":"UI emoji picker that submitted before a selection was made; client sending the emoji under 'reactionName' or 'name' instead of 'emoji'; migration from the deprecated 'reaction' field where the new field name was not added.","solutions":["Include a non-empty 'emoji' field in the body, formatted as ':shortcode:' (e.g. ':thumbsup:').","Pick the value from the emoji picker / server emoji list to ensure it is a known shortcode.","If migrating, prefer 'emoji' over the legacy 'reaction' key."],"exampleFix":"// before\nawait POST('/api/v1/chat.react', { messageId, reactionName: ':smile:' });\n// after\nawait POST('/api/v1/chat.react', { messageId, emoji: ':smile:' });","handlingStrategy":"validation","validationCode":"function buildReactBody(messageId: string, emoji: string) {\n  const e = (emoji || '').trim();\n  if (!e) throw new Error('emoji is required, e.g. \":smile:\"');\n  return { messageId, emoji: e };\n}\n\nawait POST('/api/v1/chat.react', buildReactBody(messageId, chosenEmoji));","typeGuard":"const isReactBody = (b: unknown): b is { messageId: string; emoji: string } =>\n  typeof b === 'object' && b !== null &&\n  typeof (b as any).messageId === 'string' &&\n  typeof (b as any).emoji === 'string' && (b as any).emoji.length > 0;","tryCatchPattern":"try {\n  await POST('/api/v1/chat.react', { messageId, emoji });\n} catch (e) {\n  if ((e as any)?.error === 'error-emoji-param-not-provided') {\n    // picker returned empty selection; re-prompt user\n  }\n  throw e;\n}","preventionTips":["Disable the react submit path until an emoji is selected.","Prefer the modern 'emoji' key over the legacy 'reaction' key.","Pull emoji shortcodes from the server emoji list to avoid unknown values."],"tags":["api","rest","validation","reactions","chat"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}