Skip to content

front: include can_backtrack to stdcm pathfinding calls - #18114

Open
RomainValls wants to merge 4 commits into
devfrom
rvs/front-can-backtrack-stdcm
Open

front: include can_backtrack to stdcm pathfinding calls#18114
RomainValls wants to merge 4 commits into
devfrom
rvs/front-can-backtrack-stdcm

Conversation

@RomainValls

@RomainValls RomainValls commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

closes #18028
closes #18029

only the front commit and this editoast commit is to be reviewed

this PR will be rebased once this PR will be merged

To test the backtracking you should Enable STDCM Backtracking flag in the users settings
You can test the backtracking in LMR with this example :
St-Louis-les-Aygalades -> Miramas -> Fos
With the via being a stop (service stop or driver switch)

Signed-off-by: Angelina Kuntz <angelina.kuntz@epita.fr>
@github-actions github-actions Bot added area:front Work on Standard OSRD Interface modules area:editoast Work on Editoast Service area:integration-tests Work on Integration test, by nature related to different services kind:api-change labels Aug 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API changes

This Pull Request introduces some changes in the API:

  • please own it: notify or even prepare dedicated PR(s) to consumer projects

@RomainValls
RomainValls force-pushed the rvs/front-can-backtrack-stdcm branch from 17825c8 to ed098da Compare August 14, 2026 08:14
@RomainValls
RomainValls marked this pull request as ready for review August 14, 2026 08:16
@RomainValls
RomainValls requested review from a team as code owners August 14, 2026 08:16
@RomainValls
RomainValls requested a review from Erashin August 14, 2026 08:16
Signed-off-by: Angelina Kuntz <angelina.kuntz@epita.fr>
@ppitou
ppitou requested a review from a team as a code owner August 14, 2026 08:39

@Erashin Erashin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Looked at both front and editoast (but I don't touch the front-end very often, so I might've missed something).

const dateTimeLocale = useDateTimeLocale();
const osrdconf = useSelector(getStdcmConf);
const infraId = useSelector(getStdcmInfraID);
const canBacktrackEnabled = useSelector(getFeatureFlag('stdcmBacktrack'));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: backtrackEnabled to be coherent with useStaticPathfinding.ts

dateTimeLocale: Intl.Locale,
osrdconf: OsrdStdcmConfState
osrdconf: OsrdStdcmConfState,
canBacktrackEnabled: boolean

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: same, backtrackEnabled to be coherent with rest of the code.

'effort_curves' | 'loading_gauge' | 'max_speed' | 'length' | 'supported_signaling_systems'
>;
pathSteps: (PathItemLocation | null)[];
canBacktrack?: boolean[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't have the time to dig too much into it, but it seems weird that canBacktrack can be None here, might be nice to check it out.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is probably because we use only the first commit of the PR for the api, I did some fixup since

@emersion

Copy link
Copy Markdown
Member

Can the PR title be updated to describe what this PR does?

@RomainValls RomainValls changed the title Rvs/front can backtrack stdcm front: include can_backtrack to stdcm pathfinding calls Aug 14, 2026
@flomonster
flomonster marked this pull request as draft August 14, 2026 15:47
@flomonster
flomonster marked this pull request as ready for review August 14, 2026 15:48

@flomonster flomonster left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed editoast and docker compose.
Tested that the can_backtrack value sent to editoast takes into account the feature flag.

rolling_stock_supported_signaling_systems: BTreeSet<String>,
/// List of waypoints given to the pathfinding
path_items: Vec<PathItemLocation>,
path_items: Vec<PathfindingItem>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: PathfindingItem should be moved to this module. Since it makes more sense to have it here than stdcm.

Comment on lines +428 to +432
can_backtrack: pathfinding_input
.path_items
.get(index)
.map(|item| item.can_backtrack)
.unwrap_or(false),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
can_backtrack: pathfinding_input
.path_items
.get(index)
.map(|item| item.can_backtrack)
.unwrap_or(false),
can_backtrack: pathfinding_input.path_items[index].can_backtrack,

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

Labels

area:editoast Work on Editoast Service area:front Work on Standard OSRD Interface modules area:integration-tests Work on Integration test, by nature related to different services kind:api-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

editoast: use front-end backtrack information front: input can_backtrack information for the different stdcm endpoint calls

5 participants