Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: avoid unecessary path finding call in stdcm #10288

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

sim51
Copy link
Contributor

@sim51 sim51 commented Jan 8, 2025

fix #10144

Adding a state for pathStepsLocations and only changes its value when there is a deep diff

@sim51 sim51 requested a review from a team as a code owner January 8, 2025 16:07
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Jan 8, 2025
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Why are the pathSteps updated when touching the calendar in the first place?

Shouldn't we avoid this update instead? Otherwise we'd need to carry this workaround each time pathStep is in a useEffect()/useMemo() dependency.

@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.56%. Comparing base (0e377b3) to head (44323ef).
Report is 34 commits behind head on dev.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10288      +/-   ##
==========================================
+ Coverage   81.53%   81.56%   +0.02%     
==========================================
  Files        1059     1062       +3     
  Lines      104508   104968     +460     
  Branches      722      722              
==========================================
+ Hits        85213    85617     +404     
- Misses      19254    19310      +56     
  Partials       41       41              
Flag Coverage Δ
editoast 73.63% <ø> (-0.11%) ⬇️
front 89.31% <100.00%> (+0.05%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 87.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sim51
Copy link
Contributor Author

sim51 commented Jan 8, 2025

Temporal inputs are stored in the corresponding step. Steps defines the whole path with its constraints, which makes sense.

Ex:
Step 1 : 2025-01-05 at 10h22 Nantes
Step 2: Ancenis with a 5min Stop
Step 3: Angers

In our case we need a derivative data because we just want to find a path (not a schedule).

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Eh, sorry, I thought we had separate arrays for path and schedule, but everything is in a single StdcmPathStep type.

I don't see a better way to fix this bug!

Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Lgtm and tested

fix #10144

Adding a state for pathStepsLocations and only changes its value when
there is a deep diff

Signed-off-by: Benoit Simard <contact@bsimard.com>
@sim51 sim51 enabled auto-merge January 9, 2025 10:49
@sim51 sim51 added this pull request to the merge queue Jan 9, 2025
Merged via the queue into dev with commit d13247f Jan 9, 2025
27 checks passed
@sim51 sim51 deleted the bsi/issue-10144 branch January 9, 2025 11:33
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.

stdcm: map shakes when adjusting time
4 participants