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

Issue/12539 notification type api improvements #12580

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

JorgeMucientes
Copy link
Contributor

@JorgeMucientes JorgeMucientes commented Sep 11, 2024

API improvement of the current implementation fow: #12539

Description

Coming from this feedback: #12564 (comment) this changes aim to improve the API to handle WooNotificationType. The main change is converting WooNotificationType from enum class to sealed interface

Testing information

Passing the build checks should be enough. But in case you want to ensure everything works well feel free to smoke tests the push notifications.

The tests that have been performed

Smoke-tested push notifications

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@JorgeMucientes JorgeMucientes changed the base branch from trunk to issue/12539-blaze-push-notification-navigation September 11, 2024 15:19
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 11, 2024

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitd32fc94
Direct Downloadwoocommerce-wear-prototype-build-pr12580-d32fc94.apk

BLAZE_CANCELLED_NOTE,
BLAZE_PERFORMED_NOTE,
sealed interface WooNotificationType : Parcelable {
val trackingValue: String
Copy link
Contributor Author

@JorgeMucientes JorgeMucientes Sep 11, 2024

Choose a reason for hiding this comment

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

Had to add this property to ensure we keep the same tracking values we were previously using in NotificationAnalyticsTracker.

Base automatically changed from issue/12539-blaze-push-notification-navigation to trunk September 11, 2024 15:47
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 11, 2024

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitd32fc94
Direct Downloadwoocommerce-prototype-build-pr12580-d32fc94.apk

@JorgeMucientes JorgeMucientes added this to the 20.5 milestone Sep 16, 2024
@JorgeMucientes JorgeMucientes added the feature: notifications Related to notifications or notifs. label Sep 16, 2024
@JorgeMucientes JorgeMucientes marked this pull request as ready for review September 16, 2024 12:04
@JorgeMucientes JorgeMucientes requested a review from a team as a code owner September 16, 2024 12:04
@JorgeMucientes JorgeMucientes requested review from hichamboushaba and removed request for a team September 16, 2024 12:04
@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 52.17391% with 11 lines in your changes missing coverage. Please review.

Project coverage is 40.63%. Comparing base (318fe1f) to head (d32fc94).
Report is 266 commits behind head on trunk.

Files with missing lines Patch % Lines
...merce/android/notifications/WooNotificationType.kt 42.85% 8 Missing ⚠️
...ocommerce/android/ui/main/MainActivityViewModel.kt 50.00% 1 Missing and 1 partial ⚠️
...oid/notifications/local/LocalNotificationWorker.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #12580   +/-   ##
=========================================
  Coverage     40.62%   40.63%           
+ Complexity     5669     5666    -3     
=========================================
  Files          1228     1228           
  Lines         68944    68943    -1     
  Branches       9549     9549           
=========================================
+ Hits          28010    28012    +2     
- Misses        38357    38358    +1     
+ Partials       2577     2573    -4     

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

@hichamboushaba hichamboushaba self-assigned this Sep 18, 2024
Copy link
Member

@hichamboushaba hichamboushaba left a comment

Choose a reason for hiding this comment

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

Nice work, thanks @JorgeMucientes for taking care of this.

I left a question about a change to the trackingValue for Blaze notifications, please check it out before merging this.

sealed interface BlazeStatusUpdate : WooNotificationType, Parcelable {
@Parcelize
data object BlazeApprovedNote : BlazeStatusUpdate {
@IgnoredOnParcel override val trackingValue: String = "blaze_approved_note"
Copy link
Member

Choose a reason for hiding this comment

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

Question, is having these lowercase for Blaze expected? I think they were using upper case previously.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch @hichamboushaba. Yes, previously we were tracking upper case values for Blaze pushes. While it wasn't a big deal, that was actually different from what we agreed and defined in the PT tracking section for both platforms: pffQ75-GL-p2 .
So, given that I was refactoring and fixing this, I decided to set the values correctly. I don't think it will be a big deal that for a couple versions we tracked the Blaze values in upper case style.

@JorgeMucientes JorgeMucientes merged commit d434516 into trunk Sep 19, 2024
14 checks passed
@JorgeMucientes JorgeMucientes deleted the issue/12539-notification-type-api-improvements branch September 19, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: notifications Related to notifications or notifs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants