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

🐛 Bug Report: Account create type 'Null' is not a subtype of type 'bool' #73

Closed
2 tasks done
einverne opened this issue Feb 6, 2025 · 2 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@einverne
Copy link

einverne commented Feb 6, 2025

👟 Reproduction steps

When I tried to use Account.create(), exception happend.

type 'Null' is not a subtype of type 'bool'
Image Image

👍 Expected behavior

Expect that create method return the User.

👎 Actual Behavior

But it failed and threw the exception. At the line

      targets: List<Target>.from(map['targets']?.map((p) => Target.fromMap(p)) ?? []),
  factory User.fromMap(Map<String, dynamic> map) {
    return User(
      $id: map['\$id'].toString(),
      $createdAt: map['\$createdAt'].toString(),
      $updatedAt: map['\$updatedAt'].toString(),
      name: map['name'].toString(),
      password: map['password']?.toString(),
      hash: map['hash']?.toString(),
      hashOptions: map['hashOptions'],
      registration: map['registration'].toString(),
      status: map['status'] ?? false,
      labels: List<String>.from(map['labels']?.map((x) => x.toString()) ?? []),
      passwordUpdate: map['passwordUpdate'].toString(),
      email: map['email'].toString(),
      phone: map['phone'].toString(),
      emailVerification: map['emailVerification'] ?? false,
      phoneVerification: map['phoneVerification'] ?? false,
      mfa: map['mfa'] ?? false,
      prefs: Preferences.fromMap(map['prefs'] ?? {}),
      targets: List<Target>.from(map['targets']?.map((p) => Target.fromMap(p)) ?? []),
      accessedAt: map['accessedAt'].toString(),
    );
  }

🎲 Appwrite version

Version 0.10.x

💻 Operating system

MacOS

🧱 Your Environment

Appwrite Dart 14.0.0
Appwrite self-hosted 1.6.0

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@einverne einverne added the bug Something isn't working label Feb 6, 2025
@einverne
Copy link
Author

einverne commented Feb 6, 2025

Target model has expired attribute, but the response do not have this field.

Image

@einverne
Copy link
Author

einverne commented Feb 8, 2025

I have figured it out, it is a bug of Appwrite 1.6.0, I have upgraded to the latest Appwrite 1.6.1, and the problem is fixed.

@einverne einverne closed this as completed Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant