fix: refresh push token from settings - WPB-27858 - #5021
Conversation
Test Results3 073 tests 3 046 ✅ 3m 39s ⏱️ Results for commit 7e6d667. ♻️ This comment has been updated with latest results. Summary: workflow run #31489007772 |
There was a problem hiding this comment.
Pull request overview
This PR updates the “Reset Push Notifications Token” action in Advanced Settings to explicitly clear the cached APNS push token before re-triggering push token configuration, addressing cases where repeated uploads may reuse a stale cached token and prevent expected background behavior (e.g., NSE not being triggered).
Changes:
- Switch the Advanced Settings reset action from
validatePushToken()to the newrefreshPushToken()API. - Add
ZMUserSession.refreshPushToken()to clearPushTokenStorage.pushTokenand re-run push token configuration. - Add a unit test to verify the cached push token is cleared and token configuration is invoked.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| wire-ios/Wire-iOS/Sources/UserInterface/Settings/CellDescriptors/SettingsCellDescriptorFactory+Advanced.swift | Updates the settings action to call refreshPushToken() when resetting the push token. |
| wire-ios-sync-engine/Source/UserSession/ZMUserSession/ZMUserSession+Push.swift | Adds refreshPushToken() to clear the cached token and re-trigger push token configuration. |
| wire-ios-sync-engine/Tests/Source/UserSession/ZMUserSessionTests+PushNotifications.swift | Adds a unit test covering the new refresh behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@MohamadJaara what logs do you refer to ? |
will send em to you in 1:1 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Closing this for now but will check this PR for https://wearezeta.atlassian.net/browse/WPB-26944 |
|
Re-opening with specific ticket number |
This is no longer used
samwyndham
left a comment
There was a problem hiding this comment.
Nice work @MohamadJaara. I did just a tiny change to remove the old validatePushToken() method which is no longer needed.
Issue
nse is not triggered at all in the background despite the logs showing the post request for the push token returning 200 11 times
my theory is the token is stale the btn only upload the same cached token over and over again, this change will make it so the cache is cleared and the app ask the system for the current token
Testing
login and click the "Reset Push Notifications Token" btn
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: