-
Notifications
You must be signed in to change notification settings - Fork 74
Fetch conflicts after train simulation update #16701
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,6 +206,7 @@ const useScenarioData = (scenario: ScenarioWithDetails, infraId: number, timetab | |
| }).unwrap(); | ||
|
|
||
| setTrainScheduleDepartureTime(trainScheduleId, newDeparture); | ||
| dispatch(osrdEditoastApi.util.invalidateTags(['conflicts'])); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is doing manually something that rtk-query should be doing automatically. Do we have a good reason to do so? |
||
| }, | ||
| [trainSchedules] | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -268,6 +268,7 @@ const osrdEditoastApi = generatedEditoastApi | |
| }), | ||
| }) | ||
| .enhanceEndpoints({ | ||
| addTagTypes: ['conflicts'] as const, | ||
| endpoints: { | ||
| getLightRollingStock: { | ||
| transformResponse: (response: GetLightRollingStockApiResponse) => ({ | ||
|
|
@@ -281,8 +282,11 @@ const osrdEditoastApi = generatedEditoastApi | |
| // As we always use all get train_schedule endpoints after updating the timetable, | ||
| // we don't want to invalidate the train_schedule tags here to prevent multiple calls | ||
|
|
||
| getTimetableByIdConflicts: { | ||
| providesTags: ['conflicts'], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This removes the current tags, (Note, I don't understand why we need a new tag type.) |
||
| }, | ||
| deleteTrainSchedules: { | ||
| invalidatesTags: ['timetable', 'scenarios'], | ||
| invalidatesTags: ['timetable', 'scenarios', 'conflicts'], | ||
| }, | ||
| postTrainScheduleSetsByIdTrainSchedules: { | ||
| invalidatesTags: ['train_schedule_set', 'scenarios', 'timetable'], | ||
|
|
||
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.
Obtaining new simulations shouldn't invalidate any previously fetched conflicts.
Invalidating conflicts means that conflicts have changed. Obtaining simulations doesn't mutate any train schedule, so that can't invalidate conflicts.