appwrite / sdk-for-flutter

[READ-ONLY] Official Appwrite Flutter SDK πŸ’™
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
369 stars 110 forks source link

πŸ› Bug Report: cannot sign in #194

Closed aednlaxer closed 8 months ago

aednlaxer commented 8 months ago

Hi, I'm facing this issue after upgrading from 11.0.1 to 12.0.1.

πŸ‘Ÿ Reproduction steps

  1. Create an instance of Client
  2. Create an instance of Account
  3. Sign in to Google using createOAuth2Session
  4. Load account data using account.get()

πŸ‘ Expected behavior

Sign-in should work and account.get() should return a signed in user, no exception should be thrown

πŸ‘Ž Actual Behavior

An exception is thrown:

NoSuchMethodError (NoSuchMethodError: The method 'map' was called on null.
Receiver: null
Tried calling: map(Closure: (dynamic) => Target))

Code that causes the issue is in user.dart:

targets: List<Target>.from(map['targets'].map((p) => Target.fromMap(p))),

In addition there's a similar issue with mfa field:

mfa: map['mfa'],

🎲 Appwrite version

Different version (specify in environment)

πŸ’» Operating system

MacOS

🧱 Your Environment

Flutter 3.19.0 β€’ channel stable Appwrite Flutter: ^12.0.1 Appwrite cloud 1.4.13

πŸ‘€ Have you spent some time to check if this issue has been raised before?

🏒 Have you read the Code of Conduct?

EVDOG4LIFE commented 8 months ago

Hey @aednlaxer, thanks for filing this. Appwrite Cloud is on 1.4.13, and the latest supported version for the Flutter SDK will be 11.0.1. Please try downgrading to the latest supported version for 1.4.13 as 12.0.1 for the Flutter SDK is intended for use with Appwrite 1.5.x.

We plan on upgrading Cloud within the next few weeks.

nank1ro commented 7 months ago

I lost a couple of hours for this bug. Please don't release on pub dev a new version that is using a different Appwrite Cloud version until it is ready. You may publish the package as a preview instead https://dart.dev/tools/pub/publishing#publishing-previews or as a pre-release https://dart.dev/tools/pub/publishing#publishing-prereleases