Repository navigation
fix(webui): reload history immediately when a filter is applied/cleared - #121
Merged
Merged
Conversation
When a column filter (custom value or checkbox) is applied or cleared in the History tab, the code only re-rendered the already-loaded rows (snifferRefreshRender). The first filter application therefore showed far fewer lines than the next live refresh: the small initial page (limit = page size, e.g. 100) was only filtered client-side, and the large 20000-row window was only fetched on the next SSE/poll tick — suddenly adding many lines the user never saw on first filter. Apply/clear now reset to page 1 and call snifferLoadHistory() for the history table, so the full server window is fetched immediately. The time-range filter already did this; custom-value and checkbox filters now behave the same. Verified with Playwright: applying a checkbox filter issues an immediate /history/flat?slaveid=5&limit=20000 request (was: no request at all until the next live tick).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Applying a column filter (custom value or checkbox) in the History tab showed far fewer lines than the next live refresh added moments later — as if the first filter load was missing rows.
Root cause:
applySnifferCustomFilter()and the checkbox handler inopenSnifferFilterPopup()only calledsnifferRefreshRender()— a client-side re-filter of the already-loaded rows. The history table initially loads only the current page (limit = page size, e.g. 100). So the first filter application filtered those 100 rows locally and did not hit the server. Only on the next SSE/poll tick didsnifferRefresh()firesnifferLoadHistory()— and that request, seeing the now-active filter, usedlimit=20000without offset, suddenly showing hundreds of matching lines that "were missing" on first filter.Fix
applySnifferCustomFilter()and the checkbox toggle handler now detect the History table and:snifferHistoryPage = 1,snifferLoadHistory()immediately (fetch the full 20000-window server-side with the filter pushed toslaveid/addressparams where applicable).clearSnifferFilter()gets the same treatment. The time-range filter already did this — these two paths now behave identically.Verification (Playwright, mocked server with 600 rows / 2 slaves)
Request log before fix:
history/flat?busid=0&limit=100&offset=0only — the checkbox click produced no new request.After fix:
The full matching window is fetched right away, so the visible count on first filter equals what later live refreshes show.