[Reporting] Add Refresh parameter to Delete query #78516
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Problem: When a report is deleted from the listing of reporting jobs in Management, the page immediately runs a followup call to get the latest list of jobs from the server. This allows the listing to remove the item from the list as soon as the user clicks delete, and then immediately get a refreshed state from the server. However, it has been reported that when the page syncs with the server the first time, stale job items still come up in the result and do not go away until the second refresh from the UI.
This PR fixes the problem by causing Elasticsearch to clear the cache of old results after deleting documents. That way, the next time Reporting asks for a list of all the reports, the deleted ones do not appear.
This fixes a problem of the state of the server that the user perceives, and unfortunately for now requires manual testing.
Release note: fixed a problem in the list of Reports jobs in Management would not refresh with the correct items immediately after deleting a report from the listing.
Closes #76543