-
Notifications
You must be signed in to change notification settings - Fork 138
Update how the app decides whether to accept a push notification #15222
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
base: issue/woomob-2042-add-fallback-to-wpcom-pn-system
Are you sure you want to change the base?
Update how the app decides whether to accept a push notification #15222
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## issue/woomob-2042-add-fallback-to-wpcom-pn-system #15222 +/- ##
====================================================================================
Coverage 38.70% 38.70%
- Complexity 10559 10562 +3
====================================================================================
Files 2194 2194
Lines 124978 124985 +7
Branches 17302 17305 +3
====================================================================================
+ Hits 48372 48380 +8
+ Misses 71709 71708 -1
Partials 4897 4897 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hey @irfano the code changes look good, however, I think we can do this in a cleaner way once we merge the changes from the PR I'll open tomorrow early morning (I'm wrapping up testing changes): #15238. |
…system - Bypass user ID and `remoteNoteId` validation checks when `WOO_PUSH_NOTIFICATIONS_SYSTEM` feature flag is enabled. - Skip WPCOM notifications when the app is registered with Woo Core to avoid duplicates.
…ComPushNotificationStore
…tatus in NotificationMessageHandlerTest
823bd27 to
8a42fa9
Compare
|
I've rebased onto your branch. Let's merge yours first since this is smaller. I agree that using |
Closes WOOMOB-1957
Description
This PR adds deduplication logic to
NotificationMessageHandlerto prevent duplicate push notifications. WhenWOO_PUSH_NOTIFICATIONS_SYSTEMfeature flag is enabled, we check if the incoming notification is from WPCOM (note_id > 0) and if the device is already registered with Woo Core (hasPushToken()). If both conditions are true, we skip the WPCOM notification since the same event will also arrive via Woo Core.Test Steps
Images/gif
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.