Back

Cloud function returning previews value

  • 0
  • Self Hosted
  • Flutter
  • Functions
Namka
6 Dec, 2023, 04:51

I called 2 cloud functions which suppose to send email to user. But It's returning previews functions data. I mean that data is completely changed. I am using 1.1.2 and dart 2.17 for cloud function try { final result = await state.functions.createExecution( functionId: EnvConfig.instance.appwriteSendEmailFunctionId, data: data); print(result.toMap()); print(result.response); print(result.stderr); print(result.stdout); } on Exception catch (e) { print('error'); print(e); } This is how I call my function

TL;DR
The user is experiencing an issue where their cloud function is returning the wrong data. They are using Appwrite 1.1.2 and Dart 2.17. The user is advised to update their SDK to version 7.1.0 and ensure they are using the correct version of the Dart SDK. The suggested solution is to try the 7.1.0 version of the Dart SDK. No specific solution for the incorrect data issue is provided in the thread.
VincentGe
6 Dec, 2023, 09:20

Which version of Appwrite Dart SDK are you using?

VincentGe
6 Dec, 2023, 09:20

Make sure you use the version of Dart SDK for 1.1.2

Namka
6 Dec, 2023, 09:27

1.1.2 Everything is for 1.1.2 cli and appwrite

VincentGe
6 Dec, 2023, 09:48

So for Dart SDKs: https://github.com/appwrite/sdk-for-dart/releases

You'll probably wanna try 7.1.0?

VincentGe
6 Dec, 2023, 09:48

Functions for 1.1.2 has a different signature compared to 1.4.x

VincentGe
6 Dec, 2023, 09:48

You might need to use an older SDK if you're on Appwrite 1.1.2

Namka
6 Dec, 2023, 09:49

Yes sir i using dart_appwrite: ^4.0.2

VincentGe
6 Dec, 2023, 09:49

You might need to update your SDK in that case

VincentGe
6 Dec, 2023, 09:55

So in short, Appwrite functions can be executed synchronously and asynchronously.

  • Synchronous executions will return the result immediately
  • Asynchronous executions will return the execution summary like what you see.

async is default false in newer SDKs.

https://appwrite.io/docs/references/1.1.x/server-dart/functions#createExecution

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more