osrd icon indicating copy to clipboard operation
osrd copied to clipboard

front: prevent duplicate path step IDs in upsertPathStepsInOPs()

Open emersion opened this issue 1 month ago • 1 comments

Since a map() was used, any path step matching an OP could get added multiple times. Ensure we only add it a single time.

Plus another commit from https://github.com/OpenRailAssociation/osrd/pull/10006 so that this fix affects the times and stops table, plus a tiny cleanup.

See individual commits.

Closes: https://github.com/OpenRailAssociation/osrd/issues/13939

emersion avatar Dec 12 '25 13:12 emersion

There's something weird. Afaik considering how the infra is built, we should either have repeated ops with same info but different positions on path, or overlapping ops with different information but the same position. However, the model should not allow the same op to be present twice with both the same info and the same location (and hence position on path).

So since the map checks both op info and position, it should already be unique. Do you have a case where it's not?

Synar avatar Dec 15 '25 17:12 Synar