{"record":{"id":"c9201ceb495b2b4e","repo":"a-b-street/abstreet","slug":"none-of-the-edits-apply-to-this-map","errorCode":null,"errorMessage":"None of the edits apply to this map","messagePattern":"None of the edits apply to this map","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"map_model/src/edits/mod.rs","lineNumber":231,"sourceCode":"                let value = serde_json::from_slice(&bytes)?;\n                compat::upgrade(value, map)?\n            }\n        };\n\n        // Don't compare the full MapName; edits in one part of a city could apply to another. But\n        // make sure at least the city matches. Otherwise, we spend time trying to match up edits,\n        // and produce noisy logs along the way.\n        if map.get_name().city != perma.map_name.city {\n            bail!(\n                \"Edits are for {:?}, but this map is {:?}\",\n                perma.map_name.city,\n                map.get_name().city\n            );\n        }\n\n        let edits = perma.into_edits_permissive(map);\n        if edits.commands.is_empty() {\n            bail!(\"None of the edits apply to this map\");\n        }\n        Ok(edits)\n    }\n\n    /// Load map edits from the given JSON bytes. Strip out any commands that're broken because\n    /// they don't match the current map. If the resulting edits are totally empty, consider that a\n    /// failure -- the edits likely don't cover this map at all.\n    pub fn load_from_bytes(map: &Map, bytes: Vec<u8>) -> Result<MapEdits> {\n        let perma = match abstutil::from_json::<PermanentMapEdits>(&bytes) {\n            Ok(perma) => perma,\n            Err(_) => {\n                // The JSON format may have changed, so attempt backwards compatibility.\n                let contents = std::str::from_utf8(&bytes)?;\n                let value = serde_json::from_str(contents)?;\n                compat::upgrade(value, map)?\n            }\n        };\n        let edits = perma.into_edits_permissive(map);","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/map_model/src/edits/mod.rs#L213-L249","documentation":"After permissively upgrading an edit file (dropping commands that no longer fit the map), load_from_file requires at least one command to survive. If every command was stripped as broken, the edit is empty and considered useless, so it errors instead of returning empty edits.","triggerScenarios":"Calling Edits::load_from_file with an edit JSON whose commands all fail compat checks (stale lane types, changed lane counts, unknown roads/intersections) against the current map.","commonSituations":"Loading very old edits after major OSM/map regeneration; loading an edits file that was already fully applied; wrong city edits whose IDs coincidentally resolve to nothing valid.","solutions":["Recreate the edits from scratch against the current map.","Load the map version the edits were saved against.","Inspect compat upgrade logs to see which commands were dropped and manually fix the JSON."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match Edits::load_from_file(map, path) {\n    Ok(e) => Ok(e),\n    Err(err) if err.to_string().contains(\"None of the edits apply\") => {\n        warn!(\"all edits stale; starting fresh\");\n        Ok(Edits::new(map.get_name().clone()))\n    }\n    Err(err) => Err(err),\n}","preventionTips":["Recreate edits periodically rather than maintaining ancient files.","Review permissive-upgrade warnings to learn which commands died and why.","Archive edits together with the map build they were made on."],"tags":["edits","compatibility","empty-result"],"backgroundTag":"schema-validation-failed","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"}