{"record":{"id":"feffb56822144345","repo":"stablyai/orca","slug":"custom-view-model-is-required","errorCode":null,"errorMessage":"Custom view model is required","messagePattern":"Custom view model is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/linear.ts","lineNumber":56,"sourceCode":"  return typeof value === 'string' && value.trim() ? value.trim() : undefined\n}\n\nfunction normalizeWorkspaceSelection(value: unknown): LinearWorkspaceSelection | undefined {\n  const workspaceId = normalizeWorkspaceId(value)\n  return workspaceId as LinearWorkspaceSelection | undefined\n}\n\nfunction normalizeConcreteWorkspaceId(value: unknown): string {\n  const workspaceId = normalizeWorkspaceId(value)\n  if (!workspaceId || workspaceId === 'all') {\n    throw new Error('Concrete Linear workspace ID is required')\n  }\n  return workspaceId\n}\n\nfunction normalizeCustomViewModel(value: unknown): LinearCustomViewModel {\n  if (value !== 'issue' && value !== 'project') {\n    throw new Error('Custom view model is required')\n  }\n  return value\n}\n\nfunction normalizeIdList(value: unknown, fieldName: string): string[] | undefined {\n  if (value === undefined) {\n    return undefined\n  }\n  if (\n    !Array.isArray(value) ||\n    !value.every((id): id is string => typeof id === 'string' && Boolean(id.trim()))\n  ) {\n    throw new Error(`Invalid ${fieldName}`)\n  }\n  return value.map((id) => id.trim())\n}\n\nfunction normalizeOptionalDate(value: unknown, fieldName: string): string | undefined {","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/linear.ts#L38-L74","documentation":"Thrown by normalizeCustomViewModel when the model argument for a Linear custom view request is neither 'issue' nor 'project'. Linear custom views can be scoped to either issues or projects, and the API needs to know which entity type to fetch. Any other value (including undefined, a typo, or a future model name) is rejected.","triggerScenarios":"Calling linear:getCustomView with args.model set to a value other than 'issue' or 'project'. Commonly model is undefined when the caller forgets to specify it, or a number/typo is passed.","commonSituations":"A new caller omits the model field. A UI dropdown defaults to an empty/placeholder value that is forwarded to the IPC call. The model string is sourced from user input without restricting to the allowed set.","solutions":["Always pass model as either 'issue' or 'project' when calling linear:getCustomView.","Constrain the UI control to a two-option selector and disallow a blank submission.","Validate the model against the union type before invoking the IPC call."],"exampleFix":"// before\nawait ipc.call('linear:getCustomView', { viewId, workspaceId })\n\n// after\nconst model: LinearCustomViewModel = view.target === 'issues' ? 'issue' : 'project'\nawait ipc.call('linear:getCustomView', { viewId, model, workspaceId })","handlingStrategy":"type-guard","validationCode":"const model = args.model\nif (model !== 'issue' && model !== 'project') {\n  throw new Error(\"Custom view model must be 'issue' or 'project'\")\n}","typeGuard":"function isCustomViewModel(value: unknown): value is 'issue' | 'project' {\n  return value === 'issue' || value === 'project'\n}","tryCatchPattern":null,"preventionTips":["Constrain the model UI control to exactly 'issue' and 'project'.","Always pass model explicitly; never let it default to undefined.","Use the LinearCustomViewModel union type at the call site."],"tags":["linear","validation","custom-view","ipc"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}