Skip to content

Handle invalid API key on register-queue #737

@gnprice

Description

@gnprice

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:

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

No one assigned

    Labels

    a-apiImplementing specific parts of the Zulip server APIa-logina-syncEvent queue; retry; local echo; racesbeta feedbackThings beta users have specifically asked for

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions