{"record":{"id":"27c327b9ab82b156","repo":"Kong/insomnia","slug":"appendtotimeline-timelinepath-is-outside-the-allo","errorCode":null,"errorMessage":"appendToTimeline: timelinePath is outside the allowed responses directory or does not end in .timeline","messagePattern":"appendToTimeline: timelinePath is outside the allowed responses directory or does not end in \\.timeline","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/main/ipc/main.ts","lineNumber":204,"sourceCode":"const 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);\n};\n\nexport interface RendererToMainBridgeAPI {\n  runTests: (src: string) => Promise<TestResults>;\n  loginStateChange: (isLoggedIn: boolean) => void;\n  openInBrowser: (url: string) => void;\n  restart: () => void;\n  halfSecondAfterAppStart: () => void;\n  openDeepLink: (url: string) => void;","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/main/ipc/main.ts#L186-L222","documentation":"Error \"appendToTimeline: timelinePath is outside the allowed responses directory or does not end in .timeline\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/main/ipc/main.ts:204 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"}