I'm using a GAS file as my server side for an app I'm building. I have doPost(e) and doGet(e) functions defined, for example:
function doPost(e) {
var postData = e.postData.contents;
var jsonRaw = JSON.parse(postData);
var name = jsonRaw.name;
// make a long URLFetch call...
textOutput = ContentService.createTextOutput('execution done for ' + name);
return textOutput
}
I do not have any "global" variables declared outside of a specific function's scope. My question is, if I have a long-running doPost running for user A and suddenly user B also makes a doPost request before user A's request completes, is it possible that the name variable gets reassigned and user A sees user B's name in the output?
Based on the answer here: Global Variable value not usable in multiple functions I believe I should be fine, but I wanted to confirm. Thanks!