Skip to content

front: fold deleted origin's arrival time into start time#17373

Merged
Akctarus merged 2 commits into
devfrom
tmn/front/fix-edited-train-after-removing-origin
Jul 15, 2026
Merged

front: fold deleted origin's arrival time into start time#17373
Akctarus merged 2 commits into
devfrom
tmn/front/fix-edited-train-after-removing-origin

Conversation

@Akctarus

@Akctarus Akctarus commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

closes #17341

The first waypoint of a path can't have an arrival time (the backend rejects it). This typically happens after deleting the origin: the new origin keeps the arrival offset it had as an intermediate waypoint.

To fix that and preserve the schedule, we fold that offset into the train's start time and shift the remaining waypoints arrivals back by the same amount, so every waypoint keeps the same absolute time.
I'm open to any suggestions if you've found a better way to fix this bug

@Akctarus
Akctarus requested a review from a team as a code owner June 24, 2026 15:17
@Akctarus
Akctarus force-pushed the tmn/front/fix-edited-train-after-removing-origin branch from 1568fcb to 9a2d88d Compare June 24, 2026 15:18
@github-actions github-actions Bot added the area:front Work on Standard OSRD Interface modules label Jun 24, 2026
@Akctarus
Akctarus force-pushed the tmn/front/fix-edited-train-after-removing-origin branch 4 times, most recently from 01361b9 to 6d8fd14 Compare July 1, 2026 12:24
@Akctarus
Akctarus force-pushed the tmn/front/fix-edited-train-after-removing-origin branch from 6d8fd14 to db187e8 Compare July 15, 2026 12:07
@Akctarus
Akctarus requested review from SharglutDev and Signez July 15, 2026 12:09

@Signez Signez 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! I have some ideas around the name of that function but it's more a suggestion than anything, feel free to discard.

@SharglutDev SharglutDev 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 and tested ✅

You can close the comment when fixed.

Note

@Signez, you'll have to adapt this code as well for your "drop part 2" feature :)

Akctarus added 2 commits July 15, 2026 16:20
Signed-off-by: Theo Macron <theo.macron0315@gmail.com>
Signed-off-by: Theo Macron <theo.macron0315@gmail.com>
@Akctarus
Akctarus force-pushed the tmn/front/fix-edited-train-after-removing-origin branch from ae55b68 to c8af259 Compare July 15, 2026 14:20
@Akctarus
Akctarus enabled auto-merge July 15, 2026 14:20
@Akctarus
Akctarus added this pull request to the merge queue Jul 15, 2026
Merged via the queue into dev with commit 1d10189 Jul 15, 2026
31 checks passed
@Akctarus
Akctarus deleted the tmn/front/fix-edited-train-after-removing-origin branch July 15, 2026 15:13
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.

Cannot edit train after removing the first lines if the new origin has a schedule

3 participants