{"record":{"id":"52641907fd93b29a","repo":"diegosouzapw/OmniRoute","slug":"t-suiteimportinvalid","errorCode":null,"errorMessage":"t(\"suiteImportInvalid\")","messagePattern":"t\\(\"suiteImportInvalid\"\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx","lineNumber":628,"sourceCode":"      anchor.click();\n      URL.revokeObjectURL(url);\n      notify.success(t(\"suiteExported\"), t(\"notifyEvalTitle\", { name: suite.name || suite.id }));\n    } catch (error: unknown) {\n      notify.error(\n        t(\"notifyEvalRunFailedWithReason\", {\n          reason: getErrorMessage(error) || t(\"suiteExportFailed\"),\n        }),\n        t(\"suiteExportFailed\")\n      );\n    }\n  }\n\n  async function handleImportSuite(file: File) {\n    try {\n      const text = await file.text();\n      const payload = JSON.parse(text) as ImportedEvalSuiteFile;\n      if (!payload || typeof payload !== \"object\" || !Array.isArray(payload.cases)) {\n        throw new Error(t(\"suiteImportInvalid\"));\n      }\n\n      const fallbackName =\n        file.name\n          .replace(/\\.eval-suite\\.json$/i, \"\")\n          .replace(/\\.json$/i, \"\")\n          .replace(/[-_]+/g, \" \")\n          .trim() || t(\"suiteBuilderImportedSuite\");\n\n      const draft = createDraftFromImportedSuite(payload, fallbackName);\n      setSuiteDraft({\n        ...draft,\n        name: `${draft.name} ${t(\"suiteBuilderCloneSuffix\")}`.trim(),\n      });\n      setIsBuilderOpen(true);\n      notify.success(t(\"suiteImportReady\"), t(\"notifyEvalTitle\", { name: draft.name }));\n    } catch (error: unknown) {\n      notify.error(","sourceCodeStart":610,"sourceCodeEnd":646,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx#L610-L646","documentation":"Import-shape validation in handleImportSuite: the selected file parsed as JSON but failed the structural checks (not an object, missing/invalid suites array / version marker of an exported eval-suite file). Pure client-side guard — the localized 'suiteImportInvalid' fires before any upload; no suites were created.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/usage/components/EvalsTab.tsx:628 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-export the suite file from a compatible OmniRoute instance","Verify the JSON matches the ImportedEvalSuiteFile shape (suites array present)","Pick the correct file — a single-suite export may need the bulk format"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}