-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix simulation_summary being called too often #8004
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #8004 +/- ##
=========================================
Coverage 28.05% 28.06%
Complexity 2081 2081
=========================================
Files 1289 1289
Lines 157727 157708 -19
Branches 3114 3116 +2
=========================================
+ Hits 44254 44257 +3
+ Misses 111598 111576 -22
Partials 1875 1875
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Instead of changing the OpenAPI definition side, we can override the auto-generated |
4c902b0
to
4dd33f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should maybe connect the trainResultToFetch state to the hook containing the summary endpoint to be sure that when we add a train, we fetch only the summary/getTrainSchedule of the new train and not the others that didn't changed.
Same when deleting a train.
089249c
to
9c80ff5
Compare
Thank you for the changes. Regarding my last comment, we have fresh news. A high priority issue has just came up. Most of the logic of timetable, simulation result will be changed (including You just have the build to fix and we can approve this PR I think :) |
…ainScheduleProjectPath a query. Codegen makes all the POSTs mutations by default. This one is only a POST to have a body, but is not creating/modifying anything in the DB. No reason to be considered a mutation on the frontend. As a query it doesn't have an invalidatesTags array anymore and prevents the unnecessary calls to simulation_summary.
9c80ff5
to
766b2fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thank you !
train_schedulev2
tag frompostV2TrainScheduleProjectPath
and making the endpoint a query (codegen made it a mutation by defaut as it is a POST)train_schedulev2
postV2TrainScheduleSimulationSummary
=> the endpoint should but called again if one train is updated (more refinement to come Moving a train in space-time chart trigger simulation summary and projection unnecessarily #8010 ). It should not if a train is created/removed, but we can handle that manually withtrainResultToFetch
logiccloses #7989