{"record":{"id":"0828a68ffef77aae","repo":"RocketChat/Rocket.Chat","slug":"type-not-supported","errorCode":null,"errorMessage":"Type not supported","messagePattern":"Type not supported","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"apps/meteor/ee/server/apps/communication/uikit.ts","lineNumber":192,"sourceCode":"\t\t\t\tconst result = await UiKitCoreApp.viewClosed({\n\t\t\t\t\tappId,\n\t\t\t\t\ttriggerId,\n\t\t\t\t\ttype,\n\t\t\t\t\tuser,\n\t\t\t\t\tpayload: {\n\t\t\t\t\t\tview,\n\t\t\t\t\t\tisCleared,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\t// Using ?? to always send something in the response, even if the app had no result.\n\t\t\t\tres.send(result ?? {});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Type not supported');\n\t\t}\n\t} catch (e) {\n\t\tconst error = e instanceof Error ? e.message : e;\n\t\tres.status(500).send({ error });\n\t}\n});\n\nexport class AppUIKitInteractionApi {\n\torch: IAppServerOrchestrator;\n\n\tconstructor(orch: IAppServerOrchestrator) {\n\t\tthis.orch = orch;\n\n\t\trouter.post('/:id', this.routeHandler.bind(this));\n\t}\n\n\tprivate async routeHandler(\n\t\treq: UiKitUserInteractionRequest,","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/ee/server/apps/communication/uikit.ts#L174-L210","documentation":"Thrown by POST /api/apps/ui.interaction/:id when the request body's type field matches none of the three supported core-app interaction types: 'blockAction', 'viewSubmit', 'viewClosed'. The switch's default branch rejects anything else with HTTP 500 { error: 'Type not supported' }. The endpoint only reaches the switch for apps registered as UiKitCoreApp; other app ids fall through to next().","triggerScenarios":"Posting a body with type: 'kanbanAction' or any newer/legacy interaction type to a core-app id; a typo like 'blockActions' or 'viewSubmited'; a client library from a different Rocket.Chat version emitting an interaction type this server build does not handle yet.","commonSituations":"Client/server version skew after upgrading one side (new interaction types added in newer builds); hand-rolled integrations guessing the payload schema; copy-paste from apps-engine examples that use non-core types handled elsewhere.","solutions":["Send one of the supported values for type: 'blockAction', 'viewSubmit', or 'viewClosed' with the matching payload shape for each case.","Check for typos (e.g. 'blockActions') and that the field is at the body top level.","If you need a newer interaction type, upgrade the Rocket.Chat server to a build whose uikit router supports it.","Confirm the appId in the URL is actually a UiKitCoreApp-registered core app; non-core apps bypass this handler entirely."],"exampleFix":"// before\nawait fetch(`/api/apps/ui.interaction/${appId}`, {\n  method: 'POST',\n  headers,\n  body: JSON.stringify({ type: 'blockActions', actionId, payload }), // typo -> 500\n});\n\n// after\nawait fetch(`/api/apps/ui.interaction/${appId}`, {\n  method: 'POST',\n  headers,\n  body: JSON.stringify({ type: 'blockAction', actionId, triggerId, payload, container }),\n});","handlingStrategy":"type-guard","validationCode":"const SUPPORTED = new Set(['blockAction', 'viewSubmit', 'viewClosed']);\nif (!SUPPORTED.has(payload.type)) throw new RangeError(`type must be one of ${[...SUPPORTED].join(', ')}`);","typeGuard":"type SupportedInteraction = 'blockAction' | 'viewSubmit' | 'viewClosed';\nfunction isSupportedInteraction(t: unknown): t is SupportedInteraction {\n  return t === 'blockAction' || t === 'viewSubmit' || t === 'viewClosed';\n}","tryCatchPattern":"try {\n  const res = await fetch(`/api/apps/ui.interaction/${appId}`, { method: 'POST', body: JSON.stringify(payload) });\n  if (res.status === 500) {\n    const { error } = await res.json();\n    if (error === 'Type not supported') fixPayloadType(payload);\n  }\n} catch { /* network errors only; HTTP 500 handled above */ }","preventionTips":["Type the interaction payload in the client with a literal union so invalid types fail at compile time.","Keep client SDK and server versions aligned when new interaction types appear.","Send the payload through a small serializer per interaction type instead of hand-building bodies."],"tags":["uikit","apps-engine","interaction","validation","rest-api"],"backgroundTag":"unsupported-request-type","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"}