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: fix useEffet warning in useScenarioData #10947

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

SharglutDev
Copy link
Contributor

The call to get the train schedule results was recently moved into a useQuery. By defaulting the respone with an empty array and using it in some useEffect dependencies, the useEffects were called multiple times (since the ref of the array changes at each rerender) while the endpoint was loading.

fix #10917

The call to get the train schedule results was recently moved into a useQuery.
By defaulting the respone with an empty array and using it in some useEffect dependencies, the useEffects were called multiple times (since the ref of the array changes at each rerender) while the endpoint was loading.

Signed-off-by: SharglutDev <[email protected]>
@SharglutDev SharglutDev requested a review from a team as a code owner February 25, 2025 09:13
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Feb 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 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 82.53%. Comparing base (289c4df) to head (feba57f).
Report is 25 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   #10947      +/-   ##
==========================================
+ Coverage   82.49%   82.53%   +0.03%     
==========================================
  Files        1084     1086       +2     
  Lines      107653   107936     +283     
  Branches      740      740              
==========================================
+ Hits        88807    89083     +276     
- Misses      18804    18811       +7     
  Partials       42       42              
Flag Coverage Δ
editoast 74.37% <ø> (-0.02%) ⬇️
front 90.36% <100.00%> (+0.03%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.58% <ø> (ø)
tests 87.90% <ø> (ø)

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.

Copy link
Contributor

@theocrsb theocrsb 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

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.

LGTM!

@SharglutDev SharglutDev added this pull request to the merge queue Feb 25, 2025
Merged via the queue into dev with commit d651b41 Feb 25, 2025
27 checks passed
@SharglutDev SharglutDev deleted the pfn/front/fix-use-effect-warning branch February 25, 2025 11:40
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.

useEffect warning when entering a scenario
4 participants