Rank 4: Virtual Machine
kindly assist if you're chanced
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 4: Virtual Machine
kindly assist if you're chanced
Can you check the appwrite console and see if those executions show same response?
Rank 4: Virtual Machine
okay then
Rank 4: Virtual Machine
response on client app is same with appwrite console response
@rohit90314
Rank 4: Virtual Machine
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
Rank 4: Virtual Machine
ok
Rank 4: Virtual Machine
serverside or clientside?
Rank 4: Virtual Machine
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()}");
});Rank 4: Virtual Machine
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 cachedRank 4: Virtual Machine
yes, returned getResp
Something might be wrong with your logic then
Rank 4: Virtual Machine
I crossed checked before asking for help
Rank 4: Virtual Machine
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
Rank 4: Virtual Machine
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:```dartx = "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
Rank 4: Virtual Machine
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
Rank 4: Virtual Machine
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.
Rank 4: Virtual Machine
wow, I appreciate you @safwan
Rank 4: Virtual Machine
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