Compare commits

...

2 Commits

Author SHA1 Message Date
Damien Arrachequesne
e9e5bed4f2 chore(release): socket.io-client@4.8.3
Diff: https://github.com/socketio/socket.io/compare/socket.io-client@4.8.2...socket.io-client@4.8.3
2025-12-23 17:36:53 +01:00
Damien Arrachequesne
9581f9bcfd fix(sio): do not throw when calling io.close() on a stopped server
Following [1], calling both `io.close()` and `httpServer.close()` would throw an ERR_SERVER_NOT_RUNNING exception, which was not the case before.

Related: https://github.com/socketio/socket.io/issues/5431

[1]: bb0b480d2a
2025-12-23 17:30:15 +01:00
9 changed files with 44 additions and 11 deletions

View File

@@ -2,7 +2,8 @@
| Version | Release date | Bundle size (UMD min+gzip) |
|-------------------------------------------------------------------------------------------------------------|----------------|----------------------------|
| [4.8.2](#482-2025-12-22) | December 2024 | `14.4 KB` |
| [4.8.3](#483-2025-12-23) | December 2025 | `14.4 KB` |
| [4.8.2](#482-2025-12-22) | December 2025 | `14.4 KB` |
| [4.8.1](#481-2024-10-25) | October 2024 | `14.4 KB` |
| [4.8.0](#480-2024-09-21) | September 2024 | `14.4 KB` |
| [4.7.5](#475-2024-03-14) | March 2024 | `14.6 KB` |
@@ -51,6 +52,18 @@
| [2.1.0](#210-2018-03-29) | March 2018 | `18.7 KB` |
## [4.8.3](https://github.com/socketio/socket.io/compare/socket.io-client@4.8.2...socket.io-client@4.8.3) (2025-12-23)
There were some minor bug fixes on the server side, which mandate a client bump.
### Dependencies
- [`engine.io-client@~6.6.1`](https://github.com/socketio/engine.io-client/releases/tag/6.5.2) (no change)
- [`ws@~8.18.3`](https://github.com/websockets/ws/releases/tag/8.18.3) ([diff](https://github.com/websockets/ws/compare/8.17.1...8.18.3))
## [4.8.2](https://github.com/socketio/socket.io/compare/socket.io-client@4.8.1...socket.io-client@4.8.2) (2025-12-22)

View File

@@ -1,5 +1,5 @@
/*!
* Socket.IO v4.8.2
* Socket.IO v4.8.3
* (c) 2014-2025 Guillermo Rauch
* Released under the MIT License.
*/

View File

@@ -1,5 +1,5 @@
/*!
* Socket.IO v4.8.2
* Socket.IO v4.8.3
* (c) 2014-2025 Guillermo Rauch
* Released under the MIT License.
*/

View File

@@ -1,5 +1,5 @@
/*!
* Socket.IO v4.8.2
* Socket.IO v4.8.3
* (c) 2014-2025 Guillermo Rauch
* Released under the MIT License.
*/

View File

@@ -1,5 +1,5 @@
/*!
* Socket.IO v4.8.2
* Socket.IO v4.8.3
* (c) 2014-2025 Guillermo Rauch
* Released under the MIT License.
*/

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io-client",
"version": "4.8.2",
"version": "4.8.3",
"description": "Realtime application framework client",
"keywords": [
"realtime",

View File

@@ -1,5 +1,5 @@
{
"name": "socket.io-client",
"version": "4.8.2",
"version": "4.8.3",
"type": "module"
}

View File

@@ -831,14 +831,13 @@ export class Server<
restoreAdapter();
if (this.httpServer) {
await new Promise<void>((resolve, reject) => {
return new Promise<void>((resolve) => {
this.httpServer.close((err) => {
fn && fn(err);
if (err) {
reject(err);
} else {
resolve();
debug("server was not running");
}
resolve();
});
});
} else {

View File

@@ -70,6 +70,27 @@ describe("close", () => {
});
});
it("should not throw when the underlying HTTP server is not running (callback)", (done) => {
const httpServer = createServer();
const io = new Server(httpServer);
io.close((err) => {
expect((err as Error & { code: string }).code).to.eql(
"ERR_SERVER_NOT_RUNNING",
);
done();
});
});
it("should not throw when the underlying HTTP server is not running (Promise)", (done) => {
const httpServer = createServer();
const io = new Server(httpServer);
io.close()
.then(() => done())
.catch((e) => done(e));
});
describe("graceful close", () => {
function fixture(filename) {
return (