Skip to content

Conversation

@emersion
Copy link
Member

When building an OSRD train path, we were unconditionally using the trigram from the NGE node's betriebspunktName field. This worked fine for OPs with a trigram, but fell apart for track offsets (and infrastructures without trigrams).

Instead, reconstruct the PathItemLocation from the path_item_key stored in MacroEditorState.nodes.

As a bonus, this makes it so path item location types are no longer changed to trigrams when editing a train from NGE: if a train was created with UICs from OSRD, editing it in NGE will retain UICs now.

We still need to keep the old betriebspunktName-based logic for NGE JSON file imports.

Closes: #12618

When building an OSRD train path, we were unconditionally using
the trigram from the NGE node's betriebspunktName field. This worked
fine for OPs with a trigram, but fell apart for track offsets (and
infrastructures without trigrams).

Instead, reconstruct the PathItemLocation from the path_item_key
stored in MacroEditorState.nodes.

As a bonus, this makes it so path item location types are no
longer changed to trigrams when editing a train from NGE: if a
train was created with UICs from OSRD, editing it in NGE will
retain UICs now.

We still need to keep the old betriebspunktName-based logic for
NGE JSON file imports.

Signed-off-by: Simon Ser <[email protected]>
Closes: #12618
@emersion emersion requested review from Caracol3 and Math-R October 22, 2025 08:24
@emersion emersion requested a review from a team as a code owner October 22, 2025 08:24
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Oct 22, 2025
Comment on lines 256 to 257
result.push(`trigram:${trigram}${ch ? `/${ch}` : ''}`);
result.push(`uic:${uic}${ch ? `/${ch}` : ''}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have a problem if op.extensions?.sncf and op.extensions?.identifier are null and then pass invalid keys like trigram:undefined and uic:undefined to parsePathKey() ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:front Work on Standard OSRD Interface modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NGE update error on trains with track offset

2 participants