-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pull to refresh Stats bug #20524
Conversation
Quality Gate passedIssues Measures |
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #20524 +/- ##
==========================================
- Coverage 40.43% 40.43% -0.01%
==========================================
Files 1463 1463
Lines 67301 67312 +11
Branches 11186 11190 +4
==========================================
Hits 27216 27216
- Misses 37609 37620 +11
Partials 2476 2476 ☔ View full report in Codecov by Sentry. |
WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/StatsModule.kt
Show resolved
Hide resolved
Generated by 🚫 Danger |
Fixes #20397
This PR fixes an issue where pull to refresh wouldn't update Stats. This was happening because
statsSection
was being set toTRAFFIC
with no information on time granularity. This PR mapsStatsGranularity
to its correspondingStatsSection
so that we can refresh the correctuseCase
. For example, it mapsStatsGranularity.DAYS
toStatsSection.DAYS
so the correct data can be refreshed.Alternatively, we could choose to refresh
all
granularities on pull to refresh which would remove the need for mapping with the feature flag on, but would also be less efficient.To Test:
There was a problem loading your data, refresh your page to try again
:Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones):