Websocket: unhandle rejection (#6418)
* Websocket: unhandle rejection Closes: https://github.com/parse-community/parse-server/issues/6413, https://github.com/parse-community/parse-server/issues/6173 Prevent crashing on websocket error. Bonus points to anybody who can post a specific payload that the client sends that returns an error. * log the socket * fix tests * fix payload reference link
This commit is contained in:
@@ -13,6 +13,10 @@ export class ParseWebSocketServer {
|
||||
logger.info('Parse LiveQuery Server starts running');
|
||||
};
|
||||
wss.onConnection = ws => {
|
||||
ws.on('error', error => {
|
||||
logger.error(error.message);
|
||||
logger.error(JSON.stringify(ws));
|
||||
});
|
||||
onConnect(new ParseWebSocket(ws));
|
||||
// Send ping to client periodically
|
||||
const pingIntervalId = setInterval(() => {
|
||||
|
||||
Reference in New Issue
Block a user