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

Investigate timeliness and frequency of push notifications token registration #1461

Closed
bengtan opened this issue Oct 26, 2017 · 9 comments
Closed

Comments

@bengtan
Copy link
Contributor

bengtan commented Oct 26, 2017

In order for push notifications to work, the client needs to:

  1. Obtain a push notifications token from iOS, and then
  2. Register it with the server.

The server uses the push notifications token supplied by the client to generate push notifications to send to the client.

Expected result:

I expect 1 and 2 to happen (together) quite frequently ... I'm guessing it should be within a few seconds of each app start. (The app should always do, at least, 1, after every app start because the token may have changed recently.)

Observed hypothesised result:

From time to time, we seem to encounter situations when an app's push notification token has expired or has become invalid, and yet the app hasn't registered (with the server) with a new token ... even after days or weeks.

Anecdotally, a few accounts on Staging had tokens which were registered in July, later became invalid, and yet no new tokens were registered.

This results in push notifications for affected apps (or users) becoming undeliverable.

We should investigate:

  • How often (1) happens
    • After asking iOS for the token, how long before the token is returned,
    • Does it happen after every app start?
  • How often (1) is followed by (2). The answer should be: always.

If the results aren't as expected, then we should make changes to move the actual behaviour closer to the expected behaviour.

@thescurry
Copy link

@bengtan do we still need to consider unregistering tokens on logout?

@bengtan
Copy link
Contributor Author

bengtan commented Oct 26, 2017

@thescurry: Yes. Definitely.

@zavreb
Copy link

zavreb commented Oct 27, 2017

Thought this was already ticketed...mm guess not...putting this in S18...

@bengtan
Copy link
Contributor Author

bengtan commented Nov 9, 2017

@southerneer: I notice you submitted a PR for this ticket.

Any interesting findings?

@mstidham
Copy link

mstidham commented Nov 9, 2017

@bengtan to verify (cc: @rz, @scurry)

@southerneer
Copy link
Contributor

southerneer commented Nov 9, 2017

Nothing definitive. It appeared that the existing app code was making the right calls at the right times: re-enable with fresh device info on every app foreground, disable on logout. My PR just checked enable calls for errors and waited for the return of data on disable calls (and checked for errors). The solution to the push notification problems we're seeing will most likely require further changes on the front-end, back-end, or both.

@zavreb
Copy link

zavreb commented Nov 10, 2017

@southerneer to determine next steps for this ticket. Otherwise, feel free to close it.

@southerneer
Copy link
Contributor

Yep, I think we consolidate to #1426 from here on.

@bengtan
Copy link
Contributor Author

bengtan commented Nov 24, 2017

Some observations whilst I was doing something else recently.

From observation of the server side traffic logs, the registration request of the push notifications token happens about 6-8 seconds after the client establishes a connection to the server.

So, if, for example, there is a fresh install (or reinstall?), the token won't be registered if the user opens for the app for a few seconds and then closes/backgrounds it. In other words, the app must have been in the foreground for 6-8 seconds or more in order for registration to happen.

(cc @zavreb, @mstidham, @southerneer, @toland, @thescurry)

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

No branches or pull requests

5 participants