I recently implemented a new back-end function to test out the new password reset API. Shortly after that, I am seeing errors in my log along the lines of: " WebMethod request timed-out after 14 seconds… Did you forget to resolve a promise? "
These are now happening no matter which function I call in the back-end. It is as if there is something pertaining to that new API that has caused by backend “container” to get fubar’d.
Here is the relevant code snippet from my http-functions.js file where I implemented that new API:
switch (request.path[0]) {
// OTHER FUNCTIONS HERE
case 'resetpassword': {
response.body = {[RESULT_KEY]:false}; // Default indicate failure
memberEmail = request.query[EMAIL_ARG];
deviceId = request.query[DEVICEID_ARG];
// Check the combo of email addr and device id, do we know them?
try {
await isAccessForDeviceAllowed(deviceId, memberEmail, response);
} catch (error) {
response.body = {[RESULT_KEY]:false, [ERRORMSG_KEY]: "Error establishing member data."};
return ok(response);
}
if (!response.body.result) {
// Failed to validate user+device
response.body = {[RESULT_KEY]: false, [ERRORMSG_KEY]:"Invalid website request detected for: " + memberEmail};
return ok(response);
}
try {
await authentication.sendSetPasswordEmail(memberEmail);
console.log("I successfully requested a password reset.")
response.body = {[RESULT_KEY]:true};
} catch (error) {
console.error(error);
return ok(response);
}
return ok(response);
}
}
This is the same pattern I’ve used in many other functions, which have all been working fine for months (with no timeout errors). The isAccessForDeviceAllowed method is a standard one in my back-end that was not touched and has been working for many, many months.
Btw, when I called this function in test, it worked correctly, the password reset email was sent to my user, etc. But shortly after that successful test (and after we published the backend update), I am now seeing all sorts of timeout errors.
How can I fix my back-end container? Is it possible to “reset” or “reboot” it?
All my mobile users which utilize this back-end are now prevented from using the site contents, which cripples the app. Help!!!
Thanks!