You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After first time reconnect (retries = 1), and recived a "http-status 500" (or 503, 404 ...), neffos would no try any more reconnect .
file: /src/neffos.js
line : 993:
letcheck=(): void=>{// Note:// We do not fire a try immediately after the disconnection as most developers will expect._fetch(endpointHTTP,fetchOptions).then(()=>{notifyOnline(tries);}).catch(()=>{// on network failures.// if (err !== undefined && err.toString() !== "TypeError: Failed to fetch") {// console.log(err);// }tries++;setTimeout(()=>{check();},checkEvery)});};
This would not catch any bad http-status. the new code :
letcheck=(): void=>{// Note:// We do not fire a try immediately after the disconnection as most developers will expect._fetch(endpointHTTP,fetchOptions).then((response)=>{// <--- on responseif(response.ok){// on response ok notifyOnline(tries);}else{returnPromise.reject(`${response.status}:${response.statusText}`)// <-- reject }}).catch((err)=>{// on network failures.// if (err !== undefined && err.toString() !== "TypeError: Failed to fetch") {// console.log(err);// }tries++;setTimeout(()=>{check();},checkEvery)});};
Now, even if the ws-server is restarted after a long time, the ws-client (mneffos.js) can reconnect normally.
The text was updated successfully, but these errors were encountered:
After first time reconnect (retries = 1), and recived a "http-status 500" (or 503, 404 ...), neffos would no try any more reconnect .
file: /src/neffos.js
line : 993:
This would not catch any bad http-status. the new code :
Now, even if the ws-server is restarted after a long time, the ws-client (mneffos.js) can reconnect normally.
The text was updated successfully, but these errors were encountered: