{"record":{"id":"d6cb1c6dd07cdf70","repo":"usebruno/bruno","slug":"collection-is-already-in-yml-format","errorCode":null,"errorMessage":"Collection is already in YML format","messagePattern":"Collection is already in YML format","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/yml-migration.js","lineNumber":231,"sourceCode":"      try {\n        if (fs.existsSync(ymlFile)) {\n          fs.unlinkSync(ymlFile);\n        }\n      } catch (_) {}\n    }\n    if (backupDir && !keepBackup) {\n      await fsExtra.remove(backupDir).catch(() => {});\n    }\n    throw error;\n  }\n};\n\nconst migrateCollectionToYml = async ({ mainWindow, watcher, collectionPathname, collectionUid }) => {\n  const brunoJsonPath = path.join(collectionPathname, 'bruno.json');\n  let brunoConfig;\n  try {\n    if (getCollectionFormat(collectionPathname) === 'yml') {\n      throw new Error('Collection is already in YML format');\n    }\n    brunoConfig = JSON.parse(fs.readFileSync(brunoJsonPath, 'utf8'));\n  } catch (error) {\n    try {\n      await openCollection(mainWindow, watcher, collectionPathname);\n    } catch (_) { }\n    throw error;\n  }\n  // Unmount before touching disk: detach the watcher (for a file-cache v2 mount this also\n  // stops the cache write-through riding on it, so migration's own writes/deletes aren't\n  // double-processed as live changes) and clear every cache keyed by the deterministic\n  // path-derived uid, so the post-migration reopen loads genuinely fresh state.\n  if (watcher) {\n    watcher.removeWatcher(collectionPathname, mainWindow, collectionUid);\n  }\n  try {\n    await unmount(collectionUid);\n  } catch (_) {}","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/yml-migration.js#L213-L249","documentation":"Error \"Collection is already in YML format\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/yml-migration.js:231 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed; the collection already uses YML format."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}