kindly assist if you're chanced
Can you check the appwrite console and see if those executions show same response?
okay then
response on client app is same with appwrite console response
@rohit90314
below is the response:
{"Status":"M S- yam"}
despite having separate resquest, response is same...
Please don't tag people just because you need help. Please be patient and wait for a response
Please share your code
ok
serverside or clientside?
user side:
dynamic execution = appWriteLogicExtender.functions.createExecution(
functionId: 'automate_service_sender_', data: json.encode(data));
// showloader = true
showLoaderUpdater(true);
if (kDebugMode) {
print("What is sent to server: ${data.toString()}");
}
execution.then((response) {
// show loader = false
showLoaderUpdater(false);
final decoded = json.decode(response.response);
print("What is gotten from server: ${decoded.toString()}");
});
server side:
Future<void> start(final req, final res) async {
final client = Client();
// // ////////////////////////////////
client
.setEndpoint("xxx")
.setProject("xxx")
.setKey("xxx")
.setSelfSigned(status: true);
dataFromClient = await jsonDecode(req.payload);
res.json({
'Status': getResp.toString(),
});
}```
there are other part of the code and it returns a string statement using the variable **getResp**
expecting separate response but getting same as though it is cached
yes, returned getResp
Something might be wrong with your logic then
I crossed checked before asking for help
but does appwrite cache request?
No
Add a print(req.payload)
to confirm the data is coming in correctly. Add a print(getResp.toString())
before res.json() to confirm the data is going out correctly
if (serciceTypeAndServiceName == "MTN SME") {
if (isMTNSMEAvailable.toString() == "Automated") {
x = "M S- yam";
}}
else if (serciceTypeAndServiceName == "MTN CG") {
if (isMTNCGAvailable == "Automated") {
x = "M C- yam";
}
}```
content of code, I decided to say:
```dart
x = "M S- yam";
and
x = "M C- yam";
in place of main code function to see where error was and discovered there was same response for diffrent request
Sorry I don't understand
if request has
"MTN SME"
The response should be:
x = "M S- yam";
and otherwise
but after gettin
"M S- yam";
for the below:
"MTN SME"
I still get:
"M S- yam"
for the above reqeust:
"MTN CG"
Sorry you're going to have to debug your code yourself
sighs
it's unfortunate, but the problem seems to be in your code's logic. I can try to take a look. Please show the code for your full function.
wow, I appreciate you @safwan
I discovered the dart file holding all variables on cloud function code was the one caching it. So I had to dispose them and did a check before every request, I appreciate you @Steven @safwan
I was thinking that cloud function doesn't remember any data after execution, that's why my focus was on both ends
Recommended threads
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...