Hi,
i don’t know if that bug is related to:
https://www.fusetools.com/community/forums/bug_reports/fetch_bug_when_server_not_responding
in my node.js server i have 2 functions:
exports.loginUser = function(req, res) {
//param
var params = querystring.parse(req.params.params);
var param_userName = params["userName"];
console.log("login user..");
result =
[{
"id": 1,
"username": "myName"
}]
JSONresp = { "request": req.url, "result": "OK", "data": result};
res.writeHead(200, {"Content-Type": "application/json"});
res.write(JSON.stringify(JSONresp));
res.end();
}
this one is fetched with no problem BUT if i add a timeout fuse hangs forever waiting the response:
exports.loginUser = function(req, res) {
//param
var params = querystring.parse(req.params.params);
var param_userName = params["userName"];
console.log("login user..");
setTimeout( function() {
result =
[{
"id": 1,
"username": "myName"
}]
JSONresp = { "request": req.url, "result": "OK", "data": result};
res.writeHead(200, {"Content-Type": "application/json"});
res.write(JSON.stringify(JSONresp));
res.end();
}, 1000)
}
both work when requested from browser url.
i found that bug when doing some testing on how to handle requests that took a while to process and even i don’t need that timeout function i guess that may help you to know what is going wrong.