Push preview falls back to "You have new mail" once the OAuth token has expired #1197
Closed
lucamzanon
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When a push arrives, the preview reads the message with the access token the app last saved on the server. The app only renews that token while it is open. A few hours after closing it the token has expired, the preview gets a 401 and the notification only says "You have new mail".
Fix idea: on a 401 for an OAuth login, the preview route uses the refresh token, saves the new token back into that login's cookies, and retries once. The token route and the preview would share the same helper.
This touches token handling, so I'm asking first. Does it sound ok, or would you rather solve it another way?
All reactions