{"record":{"id":"914618bd1ec1bd6a","repo":"jdx/mise","slug":"the-refreshed-plan-has-conflicts-nothing-was-chan","errorCode":null,"errorMessage":"the refreshed plan has conflicts; nothing was changed","messagePattern":"the refreshed plan has conflicts; nothing was changed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/replay.rs","lineNumber":502,"sourceCode":") -> Result<Vec<PathBuf>> {\n    let _ = (store, entries);\n    let mut round = 0;\n    let mut live;\n    loop {\n        round += 1;\n        // editors may have written while the prompt was open: re-plan\n        live = live_tree(repo, tracked)?;\n        let fresh = plan(repo, exec, &live)?;\n        let changed = actionable(&fresh) != actionable(steps);\n        if changed {\n            *steps = fresh.clone();\n            miseprintln!(\"history: the working tree changed since the plan was shown:\");\n            print_plan(steps, exec, tracked)?;\n            if steps\n                .iter()\n                .any(|step| matches!(step.action, Action::Conflict(_)))\n            {\n                bail!(\"the refreshed plan has conflicts; nothing was changed\");\n            }\n            if !exec.yes && !prompt::confirm(\"history: apply the refreshed plan?\")?.is_yes() {\n                bail!(\"declined; nothing was changed\");\n            }\n        }\n        // completeness: every path about to be written or deleted that exists\n        // now must be captured, as it is now, in the protective checkpoint\n        let Some((before_id, _)) = scope.before() else {\n            bail!(\"no protective checkpoint could be taken; nothing was changed\");\n        };\n        let before = store::entry(store, before_id)?;\n        let before_tree = before\n            .checkpoint\n            .tree\n            .snapshot\n            .clone()\n            .ok_or_else(|| eyre::eyre!(\"the protective checkpoint has no content\"))?;\n        let mut missing = vec![];","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/replay.rs#L484-L520","documentation":"If the working tree changed between when the plan was displayed and when it is applied, apply_steps re-computes the plan. If the refreshed plan still contains conflicts, it aborts with this error guaranteeing nothing was modified — the user must resolve conflicts before any apply can proceed.","triggerScenarios":"During `execute`/`apply_steps`: working tree changed after plan display, refreshed plan's steps include `Action::Conflict(_)` — e.g. another process edited/created a conflicting file while the confirmation prompt was open.","commonSituations":"Editor, dotfile sync daemon, or another mise process modifies tracked files while the user stares at the confirmation prompt; long delays between planning and confirming allow background tools to alter paths.","solutions":["Inspect the refreshed plan output, resolve the new conflicts manually, then re-run rollback/undo","Retry with `--force` if the type-changed paths are safe to replace","Close other processes touching the dotfiles (sync daemons, editors) before re-running"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// re-run planning immediately before apply and bail on conflicts\nconst fresh = computePlan();\nif (fresh.steps.some(s => s.action === 'conflict')) throw new Error('conflicts present');","typeGuard":null,"tryCatchPattern":"try {\n  await mise.dot.rollback(req);\n} catch (e) {\n  if (/refreshed plan has conflicts/.test(e.message)) {\n    // resolve, then retry once\n  }\n}","preventionTips":["Confirm prompts promptly; avoid long gaps between plan and apply","Stop dotfile sync daemons/editors during rollback","Run rollback when no other process is touching tracked paths"],"tags":["dotfiles","conflict","race-condition"],"backgroundTag":"conflicting-config-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}