Skip to content

Login / Signup flow seems broken #812

Description

@psrsingh

🐛 Describe the bug

I’m unable to reliably sign up or log in to the app.

When trying to create an account or log in with an existing one, the app sometimes silently fails and returns to the landing screen instead of continuing to onboarding/home.

From debugging, it looks like there may be a race condition in the auth flow:

  • AppwriteService.getAccount() can be called before the Appwrite client is initialized
  • splash screen navigation may happen before auth state checking finishes
  • FCM token update logic during login may also interrupt the flow

Steps to reproduce

  1. Open the app
  2. Try creating a new account
  3. Or log in with an existing account
  4. Observe that auth does not complete properly and navigation resets

Observed result

  • Login/signup does not consistently succeed
  • User may get redirected back to landing
  • Session appears to be created sometimes, but auth state/navigation does not complete correctly

Relevant code path

await account.createEmailPasswordSession(
  email: email,
  password: password,
);

await isUserLoggedIn();

There also seems to be an issue where getAccount() accesses _client before initialization is complete.

No clear UI error is shown, so the failure is mostly silent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions