Skip to content

Conversation

@RafaelKayumov
Copy link
Contributor

@RafaelKayumov RafaelKayumov commented Nov 25, 2025

Description

Runtime store switches were leaving the device unsubscribed because DefaultStoresManager.removeDefaultStore() always called unregisterForRemoteNotifications() while updateDefaultStore(storeID:) never re-registered, so users missed pushes until the next cold start. We now invoke a new helper, registerForPushNotificationsIfNeeded(), from updateDefaultStore(storeID:) to repeat the registration flow immediately (including simulator-friendly test detection via ProcessInfo.isRunningUnitTests). The change is covered by an updated MockPushNotificationsManager plus a new assertion in test_updateDefaultStore_registersForRemoteNotifications.

Test Steps

  • Sign in with a WordPress.com account that has at least two Jetpack-connected stores and accept the initial push notification permission prompt.
  • Trigger a push-worthy event (e.g., place a test order) for Store A and confirm the device receives the notification while that store is selected.
  • In the app, switch to Store B via the store picker.
  • Trigger the same kind of event for Store B and confirm the device now receives that notification without needing to relaunch the app or re-enable notifications.
  • While exercising the flow, note that no extra push-permission prompt appears and that badge counts continue to update normally.

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@RafaelKayumov RafaelKayumov added this to the 23.8 milestone Nov 25, 2025
@RafaelKayumov RafaelKayumov added the type: bug A confirmed bug. label Nov 25, 2025
@wpmobilebot
Copy link
Collaborator

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

App NameWooCommerce iOS Prototype
Build Numberpr16397-67df2ad
Version23.7
Bundle IDcom.automattic.alpha.woocommerce
Commit67df2ad
Installation URL67ep277ol8p4o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

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

Labels

type: bug A confirmed bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants