-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
notifs: Allow token-registration retry from troubleshooting; show server error message #5721
Merged
chrisbobbe
merged 6 commits into
zulip:main
from
chrisbobbe:pr-token-registration-manual-retry
Apr 24, 2023
Merged
notifs: Allow token-registration retry from troubleshooting; show server error message #5721
chrisbobbe
merged 6 commits into
zulip:main
from
chrisbobbe:pr-token-registration-manual-retry
Apr 24, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To see how this param is already passed, look for applyReducer('session', …) in src/boot/reducers.js.
gnprice
approved these changes
Apr 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! One nit in comments, but otherwise LGTM — please go ahead and merge modulo that.
src/session/sessionReducer.js
Outdated
@@ -201,6 +215,36 @@ export default (state: SessionState = initialState, action: Action): SessionStat | |||
pushToken: action.pushToken, | |||
}; | |||
|
|||
case REGISTER_PUSH_TOKEN_START: { | |||
// TODO(#5006: Do for any account, not just the active one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: close-paren (here and below)
No need for a migration; session state isn't persisted.
Now the two enum values TokenNotAcked and TokenUnknown together cover the conditions that were previously covered by just TokenNotAcked, and with no overlap. TokenUnknown will be chosen instead of TokenNotAcked when we haven't yet gotten a token from the platform.
90c2d3a
to
155c657
Compare
Thanks for the review! Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The token-registration request (
POST /users/me/apns_device_token
for iOS,POST /users/me/android_gcm_reg_id
for Android), like any API request, could fail or sit there forever without succeeding or failing. This PR will make those conditions visible to the client. And when there's a failure, we'll show it to the user, so no one has to go through server logs, and the user can retry.There might be better user-facing text to use, but even if we don't find it, I think this new information and the retry ability are worth it.
To make this screen recording I added this line in my dev server 🙂