wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.92k stars 1.3k forks source link

Refactor Mark all as read in notifications #20649

Closed jarvislin closed 4 weeks ago

jarvislin commented 4 weeks ago

Refactor #20066

The previous implementation used a loop to make API requests to mark each note as read, this will be like DDoS if many users are marking their notes read at the same time. The new implementation only uses one API request to mark all notes as read.


To Test:

  1. Sign in the JP app
  2. Switch to the notifications tab
  3. Create some unread notifications
  4. Click the three dots icon at the top-right corner
  5. Click Mark all as read
  6. The unread dots should be cleared
  7. Done, thank you!

Regression Notes

  1. Potential unintended areas of impact

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

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

    • Added some unit tests

PR Submission Checklist:


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

wpmobilebot commented 4 weeks ago
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
Versionpr20649-ffaf5de
Commitffaf5de2e15998e76d4f92055f97620789c35b7b
Direct Downloadwordpress-prototype-build-pr20649-ffaf5de.apk
Note: Google Login is not supported on these builds.
wpmobilebot commented 4 weeks ago
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
Versionpr20649-ffaf5de
Commitffaf5de2e15998e76d4f92055f97620789c35b7b
Direct Downloadjetpack-prototype-build-pr20649-ffaf5de.apk
Note: Google Login is not supported on these builds.
sonarcloud[bot] commented 4 weeks ago

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

codecov[bot] commented 4 weeks ago

Codecov Report

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

Project coverage is 40.46%. Comparing base (0384227) to head (ffaf5de). Report is 9 commits behind head on trunk.

Files Patch % Lines
...notifications/utils/NotificationsActionsWrapper.kt 0.00% 11 Missing :warning:
...src/main/java/org/wordpress/android/models/Note.kt 0.00% 3 Missing :warning:
...oid/ui/notifications/NotificationsListViewModel.kt 89.47% 0 Missing and 2 partials :warning:
...va/org/wordpress/android/util/ToastUtilsWrapper.kt 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #20649 +/- ## ======================================= Coverage 40.46% 40.46% ======================================= Files 1484 1485 +1 Lines 68413 68441 +28 Branches 11307 11312 +5 ======================================= + Hits 27683 27696 +13 - Misses 38230 38244 +14 - Partials 2500 2501 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sentry-io[bot] commented 4 weeks ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎