fix for #3380, socket.io timeout closure (#3862)

socket.io times out and closes the client side socket without any
callback
sendSocntNotification() from the server side data is lost as the socket
is closed. but the client doesn't know

increase the timeout 

fixes #3380
This commit is contained in:
sam detweiler
2025-08-28 11:02:21 -05:00
committed by GitHub
parent 3387bf8db0
commit eb719429d4
3 changed files with 7 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ Thanks to: @dathbe.
- [weather] Fixed handling of empty values in weathergov providers handling of precipitationAmount (#3859) - [weather] Fixed handling of empty values in weathergov providers handling of precipitationAmount (#3859)
- [calendar] Fix regression handling of limit days (#3840) - [calendar] Fix regression handling of limit days (#3840)
- [calendar] Fixed regression of calendarfetcherutils.shouldEventBeExcluded (#3841) - [calendar] Fixed regression of calendarfetcherutils.shouldEventBeExcluded (#3841)
- [core] Fixed socket.io timeout when server is slow to send notification, notification lost at client (#3380)
## [2.32.0] - 2025-07-01 ## [2.32.0] - 2025-07-01

View File

@@ -42,7 +42,9 @@ function Server (config) {
origin: /.*$/, origin: /.*$/,
credentials: true credentials: true
}, },
allowEIO3: true allowEIO3: true,
pingInterval: 120000, // server → client ping every 2 mins
pingTimeout: 120000 // wait up to 2 mins for client pong
}); });
server.on("connection", (socket) => { server.on("connection", (socket) => {

View File

@@ -13,7 +13,9 @@ const MMSocket = function (moduleName) {
base = config.basePath; base = config.basePath;
} }
this.socket = io(`/${this.moduleName}`, { this.socket = io(`/${this.moduleName}`, {
path: `${base}socket.io` path: `${base}socket.io`,
pingInterval: 120000, // send pings every 2 mins
pingTimeout: 120000 // wait up to 2 mins for a pong
}); });
let notificationCallback = function () {}; let notificationCallback = function () {};