{"record":{"id":"c0c48355ccb03617","repo":"Kong/insomnia","slug":"invalid-response-id","errorCode":null,"errorMessage":"Invalid response ID","messagePattern":"Invalid response ID","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/main/ipc/main.ts","lineNumber":195,"sourceCode":"  } catch (err) {\n    if (err instanceof Error) {\n      throw err;\n    }\n\n    throw new Error(String(err));\n  }\n};\n\nconst getResponsesDir = () => path.join(process.env.INSOMNIA_DATA_PATH || app.getPath('userData'), 'responses');\n\nconst responsesDirCreated = new Set<string>();\n\nconst getTimelinePath = (_: unknown, responseId: string) => {\n  const base = path.resolve(getResponsesDir());\n  const target = path.resolve(base, responseId + '.timeline');\n  const relative = path.relative(base, target);\n  if (relative.startsWith('..') || path.isAbsolute(relative)) {\n    throw new Error('Invalid response ID');\n  }\n  return target;\n};\n\nconst appendToTimeline = async (_: unknown, options: { timelinePath: string; data: string }) => {\n  const allowedResponsesDir = getResponsesDir();\n  const resolvedPath = path.resolve(options.timelinePath);\n  if (!resolvedPath.startsWith(path.resolve(allowedResponsesDir) + path.sep) || !resolvedPath.endsWith('.timeline')) {\n    throw new Error(\n      'appendToTimeline: timelinePath is outside the allowed responses directory or does not end in .timeline',\n    );\n  }\n  const dir = path.dirname(resolvedPath);\n  if (!responsesDirCreated.has(dir)) {\n    await fs.promises.mkdir(dir, { recursive: true });\n    responsesDirCreated.add(dir);\n  }\n  await fs.promises.appendFile(resolvedPath, options.data);","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/main/ipc/main.ts#L177-L213","documentation":"Error \"Invalid response ID\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/main/ipc/main.ts:195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}