{"record":{"id":"11a63d0d82971f11","repo":"RocketChat/Rocket.Chat","slug":"error-room-id-param-not-provided","errorCode":"error-room-id-param-not-provided","errorMessage":"The required \"rid\" param is missing.","messagePattern":"The required \"rid\" param is missing\\.","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/api/v1/chat.ts","lineNumber":953,"sourceCode":"\t\t\t\t\ttype: 'object',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tsuccess: { type: 'boolean', enum: [true] },\n\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 { rid, userId } = this.queryParams;\n\t\t\tlet { ignore = true } = this.queryParams;\n\n\t\t\tignore = typeof ignore === 'string' ? /true|1/.test(ignore) : ignore;\n\n\t\t\tif (!rid?.trim()) {\n\t\t\t\tthrow new Meteor.Error('error-room-id-param-not-provided', 'The required \"rid\" param is missing.');\n\t\t\t}\n\n\t\t\tif (!userId?.trim()) {\n\t\t\t\tthrow new Meteor.Error('error-user-id-param-not-provided', 'The required \"userId\" param is missing.');\n\t\t\t}\n\n\t\t\tawait ignoreUser(this.userId, { rid, userId, ignore });\n\n\t\t\treturn API.v1.success();\n\t\t},\n\t)\n\t.get(\n\t\t'chat.getDeletedMessages',\n\t\t{\n\t\t\tauthRequired: true,\n\t\t\tquery: isChatGetDeletedMessagesProps,\n\t\t\tresponse: {\n\t\t\t\t200: ajv.compile<{ messages: Pick<IMessage, '_id'>[]; count: number; offset: number; total: number }>({","sourceCodeStart":935,"sourceCodeEnd":971,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/chat.ts#L935-L971","documentation":"Thrown by GET chat.ignoreUser when the 'rid' query parameter is missing or whitespace-only. The route has no AJV query schema, so this manual trim+check at chat.ts:952 is the validation. The endpoint toggles per-user ignore in a specific room.","triggerScenarios":"GET /api/v1/chat.ignoreUser?userId=<uid>&ignore=true without rid; passing rid under 'roomId'; sending rid as an empty string.","commonSituations":"Confusing rid (room id) with roomId used by other chat.* endpoints; SDK wrapper that names the field differently; UI action invoked before the room context is loaded.","solutions":["Pass rid as a query param: chat.ignoreUser?rid=<roomId>&userId=<uid>&ignore=true.","Note the 'ignore' value must be a string ('true'/'1' for truthy) on this GET endpoint.","Confirm both rid and userId are populated before issuing the call."],"exampleFix":"// before\nGET /api/v1/chat.ignoreUser?userId=abc&ignore=true\n// after\nGET /api/v1/chat.ignoreUser?rid=GENERAL&userId=abc&ignore=true","handlingStrategy":"validation","validationCode":"function buildIgnoreUrl(rid: string, userId: string, ignore = true) {\n  if (!rid?.trim()) throw new Error('rid query param is required for chat.ignoreUser');\n  const u = new URL('/api/v1/chat.ignoreUser', location.origin);\n  u.searchParams.set('rid', rid);\n  u.searchParams.set('userId', userId);\n  u.searchParams.set('ignore', String(ignore));\n  return u;\n}","typeGuard":"const isIgnoreQuery = (q: unknown): q is { rid: string; userId: string } =>\n  typeof q === 'object' && q !== null &&\n  typeof (q as any).rid === 'string' && (q as any).rid.trim().length > 0;","tryCatchPattern":"try {\n  await GET(ignoreUrl);\n} catch (e) {\n  if ((e as any)?.error === 'error-room-id-param-not-provided') {\n    // rid missing — re-resolve from active room context\n  }\n  throw e;\n}","preventionTips":["Use 'rid' (not 'roomId') for this GET endpoint.","Pass 'ignore' as a string ('true'/'1') since GET cannot carry booleans.","Resolve rid and userId together from the active room + member list."],"tags":["api","rest","validation","query-params","chat","ignore"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}