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: Updating Attributes with Null Default Fails #47

Open
2 tasks done
jaboyc opened this issue Oct 11, 2023 · 0 comments
Open
2 tasks done

馃悰 Bug Report: Updating Attributes with Null Default Fails #47

jaboyc opened this issue Oct 11, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jaboyc
Copy link

jaboyc commented Oct 11, 2023

馃憻 Reproduction steps

When I update an attribute using Databases.update#Attribute and pass in null for xdefault,

馃憤 Expected behavior

It should set the default value of that attribute to null.

馃憥 Actual Behavior

It actually throws an exception: AppwriteException: general_argument_invalid, Param "default" is not optional. (400)

I've found that modifying https://github.com/appwrite/sdk-for-dart/blob/master/lib/src/client_mixin.dart#L15 to params.removeWhere((key, value) => value == null && key != 'default'); locally fixes the issue. Looks like the default: null header is being removed before sending the http request, which is causing the exception. This does not seem like a good fix for the issue, but it narrows down where the issue is coming from.

馃幉 Appwrite version

Version 0.10.x

馃捇 Operating system

MacOS

馃П Your Environment

Using this in a CLI script to automatically update my attributes.

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

@jaboyc jaboyc added the bug Something isn't working label Oct 11, 2023
@stnguyen90 stnguyen90 self-assigned this Oct 13, 2023
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