Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

aditi-bhatia
Copy link
Contributor

@aditi-bhatia aditi-bhatia commented Mar 23, 2024

Fixes #20397

This PR fixes an issue where pull to refresh wouldn't update Stats. This was happening because statsSection was being set to TRAFFIC with no information on time granularity. This PR maps StatsGranularity to its corresponding StatsSection so that we can refresh the correct useCase. For example, it maps StatsGranularity.DAYS to StatsSection.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:

  1. With the Stats feature flag on, navigate to the Stats page.
  2. Turn data off and change the granularity or time period.
  3. You should see There was a problem loading your data, refresh your page to try again:
Screenshot 2024-03-25 at 2 17 18 PM
  1. Turn data on again. Refresh the page and it should display data.
  2. Repeat steps 1-4 with the feature flag off.

Regression Notes

  1. Potential unintended areas of impact

    • None
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • None
  3. What automated tests I added (or what prevented me from doing so)

    • None

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing Checklist (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

Copy link

sonarcloud bot commented Mar 23, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@wpmobilebot
Copy link
Contributor

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20524-2d30d0b
Commit2d30d0b
Direct Downloadjetpack-prototype-build-pr20524-2d30d0b.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20524-2d30d0b
Commit2d30d0b
Direct Downloadwordpress-prototype-build-pr20524-2d30d0b.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Mar 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 40.43%. Comparing base (27ad674) to head (2d30d0b).
Report is 484 commits behind head on trunk.

Files Patch % Lines
...rdpress/android/ui/stats/refresh/StatsViewModel.kt 0.00% 14 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@irfano irfano removed this from the 24.6 milestone Mar 31, 2024
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

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

Successfully merging this pull request may close these issues.

Pull-to-refresh is not working on the TRAFFIC tab
4 participants