Closed obiwanzenobi closed 1 year ago
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":
{"$id":"category","$createdAt":"2023-06-08T12:45:14.832+00:00","$updatedAt":"2023-06-08T12:45:14.832+00:00","$permissions":{"0":
SDK should handle both response types array and object OR server should be consistent with a response structure.
SDK handles response only while permissions field is an array.
Different version (specify in environment)
Linux
Local selfohosted appwrite 1.3.4
@obiwanzenobi thanks for raising this! ππΌ This actually looks like a duplicate of https://github.com/appwrite/appwrite/issues/5661 so I'm going to close this. Please ππΌ the related issue.
π 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?
π’ Have you read the Code of Conduct?