Skip to content

Commit eb71942

Browse files
authored
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
1 parent 3387bf8 commit eb71942

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Thanks to: @dathbe.
3939
- [weather] Fixed handling of empty values in weathergov providers handling of precipitationAmount (#3859)
4040
- [calendar] Fix regression handling of limit days (#3840)
4141
- [calendar] Fixed regression of calendarfetcherutils.shouldEventBeExcluded (#3841)
42+
- [core] Fixed socket.io timeout when server is slow to send notification, notification lost at client (#3380)
4243

4344
## [2.32.0] - 2025-07-01
4445

js/server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ function Server (config) {
4242
origin: /.*$/,
4343
credentials: true
4444
},
45-
allowEIO3: true
45+
allowEIO3: true,
46+
pingInterval: 120000, // server → client ping every 2 mins
47+
pingTimeout: 120000 // wait up to 2 mins for client pong
4648
});
4749

4850
server.on("connection", (socket) => {

js/socketclient.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const MMSocket = function (moduleName) {
1313
base = config.basePath;
1414
}
1515
this.socket = io(`/${this.moduleName}`, {
16-
path: `${base}socket.io`
16+
path: `${base}socket.io`,
17+
pingInterval: 120000, // send pings every 2 mins
18+
pingTimeout: 120000 // wait up to 2 mins for a pong
1719
});
1820

1921
let notificationCallback = function () {};

0 commit comments

Comments
 (0)