-
Notifications
You must be signed in to change notification settings - Fork 331
Description
When the user has logged in, but then their API key changes, the server requests we make will start failing because they're using the old API key.
Currently the main symptom of this is that you open the app, try to use that account, and the spinner keeps going forever as the app just keeps retrying the registerQueue request. The logs look like:
flutter: POST https://chat.zulip.org/api/v1/register
flutter: Error fetching initial snapshot: Invalid API key
Backing off, then will retry…
flutter: … Backoff wait complete, retrying initial fetch.
flutter: POST https://chat.zulip.org/api/v1/register
flutter: Error fetching initial snapshot: Invalid API key
Backing off, then will retry…
flutter: … Backoff wait complete, retrying initial fetch.
flutter: POST https://chat.zulip.org/api/v1/register
flutter: Error fetching initial snapshot: Invalid API key
Instead, we should detect that this error is non-transient and won't be resolved by retrying. When that happens:
-
Don't retry.
-
Show an error dialog, after popping from the navigation stack any screens that were on the affected account. (This and the previous step are the same as at Disallow connecting to unsupported ancient servers #267 (comment) .)
-
Forget about the affected account, akin to Support logging out / forgetting about an account #463, so that the user can log in afresh.
(This differs from what we do for unsupported servers Disallow connecting to unsupported ancient servers #267; for an unsupported server the only thing to do is to retry after the server has been upgraded, and logging in again won't help, whereas for this situation the only thing to do is to log in again and retrying without that won't help.)
As a followup, we might introduce some sort of streamlined flow that saves the user from entering the server URL again. But that's out of scope for this PR.
Thanks to @PIG208 for reporting this issue; see chat thread.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status