{"record":{"id":"444536f10bc775b9","repo":"a-b-street/abstreet","slug":"s-road-already-points-to-dst-i","errorCode":null,"errorMessage":"{:?}'s road already points to dst_i","messagePattern":"(.+?)'s road already points to dst_i","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"map_model/src/edits/compat.rs","lineNumber":241,"sourceCode":"            let road = modified.entry(r).or_insert_with(|| map.get_r_edit(r));\n            if road.lanes_ltr[idx].lt != obj.orig_lt {\n                bail!(\"{:?} lane type has changed\", obj);\n            }\n            road.lanes_ltr[idx].lt = obj.lt;\n        } else if let Some(obj) = cmd.remove(\"ReverseLane\") {\n            let obj: ReverseLane = serde_json::from_value(obj).unwrap();\n            let (r, idx) = obj.l.lookup(map)?;\n            let dst_i = map.find_i_by_osm_id(obj.dst_i)?;\n            let road = modified.entry(r).or_insert_with(|| map.get_r_edit(r));\n            let edits_dir = if dst_i == map.get_r(r).dst_i {\n                Direction::Fwd\n            } else if dst_i == map.get_r(r).src_i {\n                Direction::Back\n            } else {\n                bail!(\"{:?}'s road doesn't point to dst_i at all\", obj);\n            };\n            if road.lanes_ltr[idx].dir == edits_dir {\n                bail!(\"{:?}'s road already points to dst_i\", obj);\n            }\n            road.lanes_ltr[idx].dir = edits_dir;\n        } else if let Some(obj) = cmd.remove(\"ChangeSpeedLimit\") {\n            let obj: ChangeSpeedLimit = serde_json::from_value(obj).unwrap();\n            let r = map.find_r_by_osm_id(obj.id)?;\n            let road = modified.entry(r).or_insert_with(|| map.get_r_edit(r));\n            if road.speed_limit != obj.old {\n                bail!(\"{:?} speed limit has changed\", obj);\n            }\n            road.speed_limit = obj.new;\n        } else if let Some(obj) = cmd.remove(\"ChangeAccessRestrictions\") {\n            let obj: ChangeAccessRestrictions = serde_json::from_value(obj).unwrap();\n            let r = map.find_r_by_osm_id(obj.id)?;\n            let road = modified.entry(r).or_insert_with(|| map.get_r_edit(r));\n            if road.access_restrictions != obj.old {\n                bail!(\"{:?} access restrictions have changed\", obj);\n            }\n            road.access_restrictions = obj.new.clone();","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/map_model/src/edits/compat.rs#L223-L259","documentation":"When upgrading a ReverseLane command, if the target road's lane already points in the direction of dst_i (the change would be a no-op), the upgrade rejects the command because re-applying it is meaningless and likely indicates the edit was already applied.","triggerScenarios":"Loading an edit file whose ReverseLane command targets a lane whose current dir already equals the edits_dir computed from dst_i — typically after the edit was already applied or the basemap changed to match.","commonSituations":"Double-applying an edit file; loading an edit after the change became part of the basemap regeneration.","solutions":["Drop the redundant ReverseLane command from the edit JSON — the desired state already holds.","Regenerate the map to reset the lane direction, then re-apply the edit.","If intentional, invert the command or remove it and re-create the edit."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// skip ReverseLane if the lane already points toward dst_i\nlet dir = if dst_i == map.get_r(r).dst_i { Direction::Fwd } else { Direction::Back };\nif map.get_r_edit(r).lanes_ltr[idx].dir == dir { /* drop redundant cmd */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't apply the same edit file twice; track applied edit filenames.","Remove redundant commands from edit files before sharing them.","Regenerate edits after changes become part of the basemap."],"tags":["edits","compatibility","no-op"],"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"}