{"record":{"id":"9bb6cc2ee883ce60","repo":"RocketChat/Rocket.Chat","slug":"error-type-param-not-supported","errorCode":"error-type-param-not-supported","errorMessage":"The \"type\" parameter must be either \"UPDATED\" or \"DELETED\"","messagePattern":"The \"type\" parameter must be either \"UPDATED\" or \"DELETED\"","errorType":"error_code","errorClass":"Meteor.Error","httpStatus":400,"severity":"error","filePath":"apps/meteor/server/publications/messages.ts","lineNumber":245,"sourceCode":"): Promise<\n\t| {\n\t\t\tupdated: IMessage[];\n\t\t\tdeleted: IMessage[];\n\t\t\tcursor?: {\n\t\t\t\tnext: string | null;\n\t\t\t\tprevious: string | null;\n\t\t\t};\n\t  }\n\t| false\n\t| IMessage[]\n\t| { messages: IMessage[]; firstUnread?: any; unreadNotLoaded?: number }\n> => {\n\tif (!(await canAccessRoomIdAsync(rid, fromId))) {\n\t\tthrow new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'messages/get' });\n\t}\n\n\tif (type && !['UPDATED', 'DELETED'].includes(type)) {\n\t\tthrow new Meteor.Error('error-type-param-not-supported', 'The \"type\" parameter must be either \"UPDATED\" or \"DELETED\"');\n\t}\n\n\tif ((next || previous) && !type) {\n\t\tthrow new Meteor.Error('error-type-param-required', 'The \"type\" parameter is required when using the \"next\" or \"previous\" parameters');\n\t}\n\n\tif (next && previous) {\n\t\tthrow new Meteor.Error('error-cursor-conflict', 'You cannot provide both \"next\" and \"previous\" parameters');\n\t}\n\n\tif ((next || previous) && lastUpdate) {\n\t\tthrow new Meteor.Error(\n\t\t\t'error-cursor-and-lastUpdate-conflict',\n\t\t\t'The attributes \"next\", \"previous\" and \"lastUpdate\" cannot be used together',\n\t\t);\n\t}\n\n\t// `fromTs` only bounds the query on the `lastUpdate` path; neither cursor pagination nor the channel","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/publications/messages.ts#L227-L263","documentation":"messages/get validates the optional type parameter, which selects which cursor history to page (live updates vs trash): it must be exactly 'UPDATED' or 'DELETED'. Anything else — including lowercase or mixed-case variants — throws Meteor.Error 'error-type-param-not-supported' before any data is fetched.","triggerScenarios":"Passing type: 'updated', 'deleted', 'UPDATE', 'INSERTED', or any other value in a messages/get call (the check runs whenever type is provided, and matters most with cursor pagination).","commonSituations":"Case typos; clients written against other APIs expecting lowercase enums; exploratory or hand-built requests; query-string whitespace or encoding artifacts around the value.","solutions":["Use the exact strings 'UPDATED' or 'DELETED'","Centralize the allowed values in a constant shared by the client","Trim and validate the parameter before sending when it comes from user input or URLs"],"exampleFix":"// before\nMeteor.call('messages/get', rid, { type: 'updated', next }); // throws error-type-param-not-supported\n\n// after\nMeteor.call('messages/get', rid, { type: 'UPDATED', next });","handlingStrategy":"validation","validationCode":"const CURSOR_PAGINATION_TYPES = ['UPDATED', 'DELETED'] as const;\nconst isCursorPaginationType = (t: unknown): boolean =>\n  typeof t === 'string' && (CURSOR_PAGINATION_TYPES as readonly string[]).includes(t);","typeGuard":"const isCursorPaginationType = (t: unknown): t is 'UPDATED' | 'DELETED' =>\n  t === 'UPDATED' || t === 'DELETED';","tryCatchPattern":null,"preventionTips":["Share a single constant of allowed type values between client and server","Reject unvalidated type values from user input before they reach the API call","Remember the check is case-sensitive: 'UPDATED'/'DELETED' only"],"tags":["pagination","messages-api","parameter-validation"],"backgroundTag":"invalid-query-parameter","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"}