{"record":{"id":"d0db9f5c38537875","repo":"a-b-street/abstreet","slug":"breaking-changes-happened-to-map-edits-between-v12-and-v13","errorCode":null,"errorMessage":"Breaking changes happened to map edits between v12 and v13. Recreate your edits from scratch; sorry.","messagePattern":"Breaking changes happened to map edits between v12 and v13\\. Recreate your edits from scratch; sorry\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"map_model/src/edits/compat.rs","lineNumber":121,"sourceCode":"            .unwrap()\n            .insert(\"version\".to_string(), Value::Number(10.into()));\n    }\n    if value[\"version\"] == Value::Number(10.into()) {\n        remove_vehicle_caps(&mut value);\n        value\n            .as_object_mut()\n            .unwrap()\n            .insert(\"version\".to_string(), Value::Number(11.into()));\n    }\n    if value[\"version\"] == Value::Number(11.into()) {\n        fix_turn_restrictions(&mut value);\n        value\n            .as_object_mut()\n            .unwrap()\n            .insert(\"version\".to_string(), Value::Number(12.into()));\n    }\n    if value[\"version\"] == Value::Number(12.into()) {\n        bail!(\"Breaking changes happened to map edits between v12 and v13. Recreate your edits from scratch; sorry.\");\n    }\n\n    abstutil::from_json(&value.to_string().into_bytes())\n}\n\n// Recursively walks the entire JSON object. Will call transform on all of the map objects. If the\n// callback returns true, won't recurse into that map.\nfn walk<F: Fn(&mut serde_json::Map<String, Value>) -> bool>(value: &mut Value, transform: &F) {\n    match value {\n        Value::Array(list) => {\n            for x in list {\n                walk(x, transform);\n            }\n        }\n        Value::Object(map) => {\n            if !(transform)(map) {\n                for x in map.values_mut() {\n                    walk(x, transform);","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/map_model/src/edits/compat.rs#L103-L139","documentation":"The edits compat layer upgrades older serialized map-edits JSON version by version. Version 12 files cannot be mechanically upgraded to 13 because the schema changed incompatibly, so upgrade() deliberately bails telling the user to recreate their edits rather than producing silently wrong output.","triggerScenarios":"Loading a saved map edits JSON file whose 'version' field is 12 through the current code (which only knows upgrades into v12 and later, and refuses 12->13).","commonSituations":"Opening an old saved edits/preset file (e.g. from an older abstreet release or a shared backup) with a newer binary; resuming an old experiment after upgrading the tool.","solutions":["Recreate the edits from scratch in the current version and save a new file, as the message says.","Check if an intermediate binary release that still wrote v12-compat upgrades is available to migrate the file first.","If the edits are simple, hand-edit the JSON to the current schema and bump 'version', validating against the current struct definitions."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"let v: serde_json::Value = serde_json::from_slice(&bytes)?;\nif v[\"version\"].as_i64() == Some(12) {\n    bail!(\"edits file is v12 and cannot be auto-upgraded; recreate or migrate it first\");\n}","typeGuard":null,"tryCatchPattern":"match Edits::load(path) {\n    Ok(e) => e,\n    Err(e) if e.to_string().contains(\"between v12 and v13\") => {\n        eprintln!(\"Old edits file can't be migrated ({e}); recreating edits from scratch.\");\n        Edits::default()\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep saving edits with the current tool version","Back up edits files and note their version before upgrading the tool","Read release notes for breaking schema changes before loading old saves"],"tags":["compatibility","versioning","map-edits","migration"],"backgroundTag":"deprecated-api-usage","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}