Skip to content

fix: Filtered SSIDs persist in time graph legend#610

Open
mdrkrg wants to merge 2 commits into
VREMSoftwareDevelopment:mainfrom
mdrkrg:fix/time-graph-filter-ssid
Open

fix: Filtered SSIDs persist in time graph legend#610
mdrkrg wants to merge 2 commits into
VREMSoftwareDevelopment:mainfrom
mdrkrg:fix/time-graph-filter-ssid

Conversation

@mdrkrg
Copy link
Copy Markdown

@mdrkrg mdrkrg commented May 29, 2026

Summary

  • Adds two failing unit tests that expose a bug where filtered-out SSIDs persist in the time graph legend after enabling a filter directly from the time graph screen.
  • These tests are first committed as TDD RED before the fix.

What does this implement/fix?

This PR adds two test cases in DataManagerTest.kt that fail:

  • newSeriesShouldNotIncludeActiveCacheEntriesNotInCurrentWiFiDetails -- verifies that newSeries() excludes cached entries that do not match the applied filter predicate.
  • adjustDataShouldNotAppendToStaleCacheEntriesNotInCurrentDetails -- verifies that adjustData() 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 merges timeGraphCache.active() entries into the return set. Since removeSeries() only removes series not in this set, filtered-out SSIDs remain visible for up to MAX_NOT_SEEN_COUNT (20) scans.

Does this close any issues?

None.

How was this tested?

  • Devices / OS (e.g. Android 13 emulator, Pixel 6): Android 15 and Unit tests
  • Platform / Build variant (e.g. debug/release): debug
  • Toolchain / Gradle / SDK version(s): Kotlin 2.3.20, AGP 9.1.1, Gradle 9.4.1
  • Steps to reproduce / test (provide exact steps so reviewers can verify): Time Graph -> Apply Filter -> See the SSIDs that should be filtered out are still in the legend.

Checklist (required before marking ready)

  • I added or updated unit tests (see app/src/test/)
  • I followed the project's coding style (ktlint) and formatting
  • I ran lint and addressed or documented any warnings
  • CI checks pass (unit tests, coverage, lint)
  • No sensitive data, keys, or secrets are included

AI Assistance

  • AI tools were used (Copilot, ChatGPT, Claude, etc.) — please add the “AI assistance used” label.
  • No AI tools were used

Additional context

None.

Reviewer notes

None.

mdrkrg added 2 commits May 29, 2026 17:16
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.
@VREMSoftwareDevelopment VREMSoftwareDevelopment added the AI assistance used Indicates that an AI assistant was used to generate this PR label May 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (727346e) to head (2d7c3a6).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assistance used Indicates that an AI assistant was used to generate this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants