Back

[Closed] TypeError in Flutter SDK (10.0.1) with Appwrite Version 1.4.1

  • 0
  • Flutter
Kryper
5 Sep, 2023, 21:06

Hello! I recently upgraded my Appwrite installation from 1.3.7 to 1.4.1 and ran the migrations. Due to the incompatibilities I had to upgrade the Flutter SDK as well as it was raising errors. Unfortunately I am still getting errors with the newest versions regarding Type "Null" responses for my documents permission.

Have I missed something or is an additional migration necessary? Every help is very appreciated, thank you.

TL;DR
The user is experiencing a TypeError in Flutter SDK (10.0.1) with Appwrite Version 1.4.1. They added system attributes to fix the issue. They are asked to create a GitHub issue and include the system attributes in their code. The user is also asked to check their code and the content of the map they are receiving. It is mentioned that the user recently upgraded their Appwrite installation and Flutter SDK, and is now experiencing Type "Null" responses for document permissions. No solution is provided in the support thread.
Drake
5 Sep, 2023, 21:16

what's your code? And can you check what's in the map?

Kryper
5 Sep, 2023, 21:22

Thank you for the quick response! As far as I understand this gets thrown directly in the Flutter SDK lib/src/models/document.dart.

It seems to me that the structure received is completely different. (Most keys are missing including id, createdAt and updatedAt ...)

I will check if the installation was really successful again. The content of the map is the following:

TypeScript
1:"owner" -> "User"
2:"members" -> List (2 items)
3:"description" -> "A basic private group"
4:"$databaseId" -> "642e85442aab0146d94f"
5:"$collectionId" -> "642e867bb648f1898e7b"```
Drake
5 Sep, 2023, 21:31

interesting...what's your code and do you have relationships?

Kryper
5 Sep, 2023, 21:40

I do use relationships as i have a custom "Group" document that has the following attributes as depicted in the screenshot.

What part of the code is of particular interest? This is the code part that calls into the SDK. To my understanding the Error gets thrown by the call to _databases.listDocuments.

TypeScript
  Future<List<Group>> _getGroupList() async {
    final groupDocuments = await _databases.listDocuments(
        databaseId: appwriteDatabaseId,
        collectionId: groupCollectionId,
        queries: [
          Query.orderDesc("\$createdAt"),
          Query.select(["groupName", "owner", "members", "description"])
        ]);

    return groupDocuments.documents
        .map((document) => Group.fromAppwriteDocument(document.data))
        .toList();
  }
Drake
5 Sep, 2023, 21:47

i see what's going on...would you please create a github issue for this?

For now, you'll need to include the system attributes in your select

Kryper
5 Sep, 2023, 21:56

Sure I can, do you have a link where this system attributes are explained?

Kryper
5 Sep, 2023, 22:11

After adding the system attributes via the following: Query.select([ "groupName", "owner", "members", "description", "updatedAt", "createdAt", "id", "permissions" ])```

this seemed to fix the issue for now.

Kryper
5 Sep, 2023, 22:12

[Closed] TypeError in Flutter SDK (10.0.1) with Appwrite Version 1.4.1

Drake
5 Sep, 2023, 22:17

will you still be able to create an issue? Ideally, it should still work without those system attributes

Kryper
5 Sep, 2023, 22:17

Already at it, should be done in 2min.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more