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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: type '_Map<String, dynamic>' is not a subtype of type 'List<dynamic>' #41

Closed
2 tasks done
obiwanzenobi opened this issue Jun 8, 2023 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@obiwanzenobi
Copy link

馃憻 Reproduction steps

While creating collection, some combination of permissions causes server to respond with a wrong type for "permissions" which leads to SDK crash.
https://github.com/appwrite/sdk-for-dart/blob/master/lib/src/models/collection.dart#L12 and https://github.com/appwrite/sdk-for-dart/blob/master/lib/src/models/collection.dart#L44

Wrong response:
{"$id":"category","$createdAt":"2023-06-08T12:45:14.832+00:00","$updatedAt":"2023-06-08T12:45:14.832+00:00","$permissions":{"0":

Screenshot 2023-06-08 at 14 40 54

馃憤 Expected behavior

SDK should handle both response types array and object OR server should be consistent with a response structure.

馃憥 Actual Behavior

SDK handles response only while permissions field is an array.

馃幉 Appwrite version

Different version (specify in environment)

馃捇 Operating system

Linux

馃П Your Environment

Local selfohosted appwrite 1.3.4

馃憖 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?

@obiwanzenobi obiwanzenobi added the bug Something isn't working label Jun 8, 2023
@stnguyen90
Copy link
Contributor

@obiwanzenobi thanks for raising this! 馃檹馃徏 This actually looks like a duplicate of appwrite/appwrite#5661 so I'm going to close this. Please 馃憤馃徏 the related issue.

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

2 participants