{"record":{"id":"0828a68ffef77aae","repo":"RocketChat/Rocket.Chat","slug":"type-not-supported","errorCode":null,"errorMessage":"Type not supported","messagePattern":"Type not supported","errorType":"exception","errorClass":"Error","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/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/ee/server/apps/communication/uikit.ts#L174-L210","documentation":"Thrown by the UiKit interaction endpoint POST /api/apps/ui.interaction/:id when req.body.type is not one of the three handled cases: 'blockAction', 'viewSubmit', or 'viewClosed'. The switch falls through to default. The outer catch converts it to a 500 response with { error: 'Type not supported' }. This route is only reached for apps registered as core UiKit apps (UiKitCoreApp.isRegistered(appId) is true); otherwise next() is called.","triggerScenarios":"POST /api/apps/ui.interaction/<appId> with a body whose type field is missing, undefined, or an unsupported value (e.g. 'modalAction', 'datepicker', a typo like 'blockActions'). The appId must resolve to a registered core UiKit app for this handler to run.","commonSituations":"App developer sends a new/undocumented interaction type; client SDK version sends a type the server does not yet recognize (version skew); typo in a hand-built payload; missing type field entirely.","solutions":["Ensure body.type is exactly 'blockAction', 'viewSubmit', or 'viewClosed' (case-sensitive).","Update the client SDK / app to a version whose interaction types match the server.","If you need a new interaction type, it must be added to the switch in apps/meteor/ee/server/apps/communication/uikit.ts.","For non-core apps, ensure the app is NOT registered as a core UiKit app if you want the orchestrator route handler instead."],"exampleFix":"// before\nfetch('/api/apps/ui.interaction/' + appId, {\n  method: 'POST',\n  body: JSON.stringify({ type: 'blockActions', actionId: 'go' })  // typo\n});\n\n// after\nfetch('/api/apps/ui.interaction/' + appId, {\n  method: 'POST',\n  body: JSON.stringify({ type: 'blockAction', actionId: 'go' })\n});","handlingStrategy":"validation","validationCode":"const SUPPORTED_UITKIT_TYPES = new Set(['blockAction', 'viewSubmit', 'viewClosed']);\n\nfunction isValidInteraction(body: unknown): boolean {\n  return typeof body === 'object' && body !== null &&\n    SUPPORTED_UITKIT_TYPES.has((body as any).type);\n}\n\nif (!isValidInteraction(req.body)) {\n  return res.status(400).send({ error: 'Unsupported interaction type' });\n}","typeGuard":"type SupportedUiKitType = 'blockAction' | 'viewSubmit' | 'viewClosed';\n\nconst isSupportedUiKitType = (t: unknown): t is SupportedUiKitType =>\n  typeof t === 'string' &&\n  ['blockAction', 'viewSubmit', 'viewClosed'].includes(t);","tryCatchPattern":"try {\n  await fetch(`/api/apps/ui.interaction/${appId}`, { method: 'POST', body: JSON.stringify(payload) });\n} catch (e) {\n  if (e instanceof Error && /Type not supported/i.test(e.message)) {\n    // client sent an unknown body.type - fix the payload, do not retry as-is\n  }\n}","preventionTips":["Validate body.type client-side against the three supported values before posting.","Keep client SDK and server versions aligned to avoid new-type skew.","Add the type to the switch in uikit.ts if you genuinely need a new interaction type.","Return 400 (not 500) for unsupported types if you control the handler."],"tags":["uikit","apps-engine","validation","interaction"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}