Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Comments

Don't reload filters until entire applyFilterList() block was completed#175

Merged
prymitive merged 1 commit intomasterfrom
history-filters
Aug 15, 2017
Merged

Don't reload filters until entire applyFilterList() block was completed#175
prymitive merged 1 commit intomasterfrom
history-filters

Conversation

@prymitive
Copy link
Contributor

setFilters() will trigger fetch of the new alerts with updated filter, it's being called after each filter is added to the filter bar, so each added filter ends up with AJAX call to /alerts.json, this means that when someone clicks on a history entry with complex rule it will trigger multiple subsequent requests. What's worse first request will have bigger response body (since it filters less) so it's likely that it will finish after the next request, leaving invalid alerts on the grid. This disable setFilters() if we apply filters in batch mode.

setFilters() will trigger fetch of the new alerts with updated filter, it's being called after each filter is added to the filter bar, so each added filter ends up with AJAX call to /alerts.json, this means that when someone clicks on a history entry with complex rule it will trigger multiple subsequent requests. What's worse first request will have bigger response body (since it filters less) so it's likely that it will finish after the next request, leaving invalid alerts on the grid. This disable setFilters() if we apply filters in batch mode.
@prymitive
Copy link
Contributor Author

It adds setFilters() to applyFilterList() and moves it down so that applyFilterList() is defined after setFilters() since it calls it.

@prymitive prymitive merged commit 71b686b into master Aug 15, 2017
@prymitive prymitive deleted the history-filters branch August 15, 2017 16:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants