Skip to content

Conversation

@stnguyen90
Copy link
Contributor

@stnguyen90 stnguyen90 commented Oct 1, 2021

When setting a JSON object string at the CLI, it is considered a string
and passed to the API as a string, even though it's expected as an
object. This change ensures that JSON object strings are decoded into
PHP arrays so that they are properly encoded when sent to the Appwrite
API.

Closes: appwrite/sdk-for-cli#14

@stnguyen90
Copy link
Contributor Author

Hmm I believe the CI build is failing due to the recent CA certificate expiring, and not due to my code. Should I look into fixing that as part of this PR?

@stnguyen90
Copy link
Contributor Author

Hmm I believe the CI build is failing due to the recent CA certificate expiring, and not due to my code. Should I look into fixing that as part of this PR?

I fixed the problem by updating the image to run the php sdk test for php version 7 to php:7.4-cli-alpine.

@christyjacob4
Copy link
Contributor

@stnguyen90 Can you share some screenshots before and after the fix ?

@stnguyen90
Copy link
Contributor Author

Here's a screenshot of the error before the fix:

Update User Preferences - Error

Here's a screenshot of the successful command after the fix:

Update User Preferences - Successful

Here's a screenshot of the updated user preferences:

Updated User Preferences

Let me know if there's anything else you need.

When setting a JSON object string at the CLI, it is considered a string
and passed to the API as a string, even though it's expected as an
object. This change ensures that JSON object strings are decoded into
PHP arrays so that they are properly encoded when sent to the Appwrite
API.
@stnguyen90 stnguyen90 force-pushed the fix-14-fix-json-encoding branch from fcf71a8 to ae78997 Compare October 16, 2021 02:28
@stnguyen90
Copy link
Contributor Author

Rebased and fixed merge conflicts.

@eldadfux eldadfux merged commit c573b9d into appwrite:master Oct 18, 2021
@eldadfux
Copy link
Member

THANK YOU! All changes merged 🥳

Please reach out to me (eldadfux) on our Discord server if you would like to claim your Appwrite swags!

Please feel free to look for more PRs you might be interested in helping with on our long list of Hacktoberfest friendly issues to help make Appwrite better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: using appwrite cli to update user prefs doesn't update them

3 participants