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

[Tags Feed] Implement retry action for error state #20839

Merged
merged 3 commits into from
May 20, 2024

Conversation

thomashorta
Copy link
Contributor

@thomashorta thomashorta commented May 16, 2024

Fixes #20823

Implement the retry action by calling the fetchTag method for the appropriate tag.
I also adjusted the height of the Error item layout, since it was not matching the height from other items, causing the vertical list content to shift.


To Test:

Suggestion: use the branch test/20823-reader-tags-feed-retry to test this PR, since the code there forces the second tag in the list to alternate between the Error and Loaded states every third time when fetching its posts, which is useful for testing the Retry behavior.

Ex: first fetch for the tag causes an Error state, second fetch does the same, third fetch loads the posts correctly, then it cycles.

  1. Open Jetpack
  2. Make sure the reader_tags_feed feature config is on (Debug Settings -> Remote features)
  3. Go to Reader
  4. Go to Your Tags feed
  5. Tap Retry on the error/empty item for a tag that failed loading/has no posts
  6. Verify it tries to fetch the posts again
  7. (if using the suggested branch) Verify it loads the posts successfully every third fetch (use pull-to-refresh and retry to fetch multiple times)

Regression Notes

  1. Potential unintended areas of impact

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

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

    • Fixed existing tests
    • Added unit tests for the retry code

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 May 16, 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

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
Versionpr20839-b028ecd
Commitb028ecd
Direct Downloadwordpress-prototype-build-pr20839-b028ecd.apk
Note: Google Login is not supported on these builds.

@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
Versionpr20839-b028ecd
Commitb028ecd
Direct Downloadjetpack-prototype-build-pr20839-b028ecd.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented May 16, 2024

Codecov Report

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

Project coverage is 40.82%. Comparing base (8255e5b) to head (b028ecd).

Files Patch % Lines
...der/viewmodels/tagsfeed/ReaderTagsFeedViewModel.kt 76.19% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           feature/tags-ia   #20839      +/-   ##
===================================================
+ Coverage            40.81%   40.82%   +0.01%     
===================================================
  Files                 1493     1493              
  Lines                68736    68750      +14     
  Branches             11346    11346              
===================================================
+ Hits                 28057    28070      +13     
- Misses               38131    38132       +1     
  Partials              2548     2548              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM an works well @thomashorta! 👍

Thanks for providing the test branch as well, I also tested the code in this PR by turning off the network an waiting for the timeout to happen for some of the tags. At that point, restoring the network, the retry worked as as expected for each tag. The PTR also worked 🎉

Approving from my side and this can be merged 👍

@thomashorta thomashorta merged commit f5bf3b1 into feature/tags-ia May 20, 2024
21 of 24 checks passed
@thomashorta thomashorta deleted the issue/20823-reader-tags-feed-retry branch May 20, 2024 14:40
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.

None yet

3 participants