๐ Bug Report: type '_Map<String, dynamic>' is not a subtype of type 'List<dynamic>'
obiwanzenobi opened this issue ยท 1 comments
๐ 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":
๐ 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?
- I have read the Code of Conduct
@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.