fix: Filtered SSIDs persist in time graph legend#610
Conversation
The DataManager now uses the Predicate to determine which difference-series entries and active cache entries are legitimate (temporarily out of range) vs filtered out. This prevents filtered SSIDs from persisting in the time graph legend after a filter is applied.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #610 +/- ##
=========================================
Coverage 97.83% 97.83%
Complexity 975 975
=========================================
Files 121 121
Lines 2581 2585 +4
Branches 211 211
=========================================
+ Hits 2525 2529 +4
Misses 19 19
Partials 37 37 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where SSIDs filtered out via the time graph filter dialog persisted in the legend for up to 20 scans. It threads the filter Predicate from TimeGraphView into DataManager.addSeriesData(), so both adjustData() and newSeries() exclude filtered-out entries from differenceSeries() and timeGraphCache.active(). New unit tests cover the filtered cache/difference paths.
Changes:
- Pass
PredicatefromTimeGraphView.update()intoDataManager.addSeriesData(). - Apply the predicate inside
adjustData()(difference series) andnewSeries()(active cache) inDataManager. - Update existing tests for the new signatures and add two new tests covering filtered-out stale entries.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/src/main/kotlin/com/vrem/wifianalyzer/wifi/timegraph/TimeGraphView.kt | Pass predicate to DataManager.addSeriesData(). |
| app/src/main/kotlin/com/vrem/wifianalyzer/wifi/timegraph/DataManager.kt | Accept predicate; filter difference series and cached active entries by it. |
| app/src/test/kotlin/com/vrem/wifianalyzer/wifi/timegraph/TimeGraphViewTest.kt | Update mocks/verifications for new addSeriesData signature. |
| app/src/test/kotlin/com/vrem/wifianalyzer/wifi/timegraph/DataManagerTest.kt | Update existing tests and add two TDD tests for filtered cache/difference behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f071df0
into
VREMSoftwareDevelopment:main
|
After reviewing the new behavior and testing it in real-world use, this PR will be reverted, for the reasons below:
Thanks for the PR. |
Summary
What does this implement/fix?
This PR adds two test cases in
DataManagerTest.ktthat fail:newSeriesShouldNotIncludeActiveCacheEntriesNotInCurrentWiFiDetails-- verifies thatnewSeries()excludes cached entries that do not match the applied filter predicate.adjustDataShouldNotAppendToStaleCacheEntriesNotInCurrentDetails-- verifies thatadjustData()does not append floor-level data points or increment TimeGraphCache counters for entries that do not match the predicate.The bug: when a user navigates directly to the time graph and enables an SSID filter,
DataManager.newSeries()unconditionally mergestimeGraphCache.active()entries into the return set. SinceremoveSeries()only removes series not in this set, filtered-out SSIDs remain visible for up toMAX_NOT_SEEN_COUNT(20) scans.Does this close any issues?
None.
How was this tested?
Checklist (required before marking ready)
app/src/test/)AI Assistance
Additional context
None.
Reviewer notes
None.