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
- Bug: Cloud Function On Schedule Didn't R...
Heya I have a cloud function with this cron `0 17 * * *` to run at 9AM PT every day. I have not touched this since I set it up, and it has been working fine s...
- functions
Code for function not being created in Github. Permissions are set correctly, repository is created, however no code is in the created repository. Just trying...
- Urgent help required - Could not resolve...
I upgraded my production environment to 1.8.0 but experienced issues with appwrite running out of worker threads. I downgraded back to 1.6.1 and restored the da...