cross-tab-worker-databus 0.20.30 → 0.20.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/index.cjs +8 -3
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/index.js +8 -3
- package/dist/index.js.map +2 -2
- package/dist/websocket.d.ts.map +1 -1
- package/docs/roadmap.md +6 -1
- package/docs/zh/roadmap.md +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Semantic Versioning](https://semver.org/);变更记录格式参考 [Keep a Changelog](https://keepachangelog.com/)。
|
|
4
4
|
|
|
5
|
+
## [0.20.31] - 2026-09-04
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- WebSocket transport now isolates stale socket lifecycle and message callbacks after stop/start replacement, preventing late frames from an old connection entering a new session.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added regression coverage for stale-socket isolation during transport replacement.
|
|
14
|
+
|
|
5
15
|
## [0.20.30] - 2026-09-04
|
|
6
16
|
|
|
7
17
|
### Added
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -2331,15 +2331,20 @@ var WebSocketTransport = class {
|
|
|
2331
2331
|
return;
|
|
2332
2332
|
}
|
|
2333
2333
|
socket.onopen = () => {
|
|
2334
|
+
if (this.socket !== socket || this.handlers !== handlers) return;
|
|
2334
2335
|
for (const topic of this.subscribedTopics) {
|
|
2335
2336
|
this.sendFrame({ op: "subscribe", topic });
|
|
2336
2337
|
}
|
|
2337
2338
|
handlers.onStatus("connected");
|
|
2338
2339
|
};
|
|
2339
|
-
socket.onclose = () =>
|
|
2340
|
-
|
|
2340
|
+
socket.onclose = () => {
|
|
2341
|
+
if (this.socket === socket && this.handlers === handlers) handlers.onStatus("disconnected");
|
|
2342
|
+
};
|
|
2343
|
+
socket.onerror = () => {
|
|
2344
|
+
if (this.socket === socket && this.handlers === handlers) handlers.onStatus("error");
|
|
2345
|
+
};
|
|
2341
2346
|
socket.onmessage = (event) => {
|
|
2342
|
-
void this.handleMessage(event.data);
|
|
2347
|
+
if (this.socket === socket && this.handlers === handlers) void this.handleMessage(event.data);
|
|
2343
2348
|
};
|
|
2344
2349
|
this.socket = socket;
|
|
2345
2350
|
}
|