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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: v1.4.4 Cloud Functions Introduces Breaking Bug #6462

Closed
2 tasks done
tannermeade opened this issue Oct 3, 2023 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@tannermeade
Copy link

👟 Reproduction steps

This change creates a big problem (at least for dart cloud functions): #6317

Change is here: https://github.com/open-runtimes/open-runtimes/blob/2a069cf9bec98e18a096633b5848cde12b4fe319/runtime

By assuming that the body HAS to be json parseable, all cloud functions will throw an error if the request is not json.

So everyone who has existing functions that accept string request bodies or anything not json parsable (or anyone who wants to in the future) can no longer do that.

All changes to make this work going forward require not only backend refactors, but frontend changes too.

It would be really nice if cloud functions stop assuming things like this. The recent big change helped reduce these assumptions by a lot, but this is still an issue.

👍 Expected behavior

The recent big change to cloud functions was in-part to reduce the assumptions appwrite makes and let the developer make those decisions. v1.4.4 introduced a breaking assumption that should not be introduced. At least wrap it in a try catch, but preferably just don't try to parse the body so the function doesn't do unnecessary work if the developer doesn't what it to.

👎 Actual Behavior

Breaks all cloud functions that don't have json parseable bodies. The breaking change requires fronend and backend changes.

🎲 Appwrite version

Version 1.4.x

💻 Operating system

Linux

🧱 Your Environment

No response

👀 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?

@tannermeade tannermeade added the bug Something isn't working label Oct 3, 2023
@stnguyen90 stnguyen90 added the product / functions Fixes and upgrades for the Appwrite Functions. label Oct 3, 2023
@stnguyen90
Copy link
Contributor

@tannermeade, thanks for raising this issue! 🙏🏼 That change you're referring to should only apply to functions triggered by events, which should always be JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

2 participants