cross-tab-worker-databus 0.20.90 → 0.20.92
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 +41 -0
- package/dist/centrifuge-session.d.ts.map +1 -1
- package/dist/centrifuge.js +7 -9
- package/dist/centrifuge.js.map +2 -2
- package/dist/centrifuge.shared.worker.js +6 -8
- package/dist/centrifuge.shared.worker.js.map +2 -2
- package/dist/centrifuge.worker.js +6 -8
- package/dist/centrifuge.worker.js.map +2 -2
- package/dist/{chunk-L24ETFVK.js → chunk-QB74C4EH.js} +249 -91
- package/dist/chunk-QB74C4EH.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +254 -98
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +258 -91
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/cluster.d.ts +8 -5
- package/dist/core/cluster.d.ts.map +1 -1
- package/dist/core/data-bus.d.ts +21 -1
- package/dist/core/data-bus.d.ts.map +1 -1
- package/dist/core/replay-manager.d.ts +17 -3
- package/dist/core/replay-manager.d.ts.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +2 -2
- package/dist/websocket.d.ts +3 -0
- package/dist/websocket.d.ts.map +1 -1
- package/docs/architecture.md +11 -6
- package/docs/benchmarks.md +8 -8
- package/docs/capabilities.md +3 -1
- package/docs/release-checklist.md +2 -2
- package/docs/roadmap.md +19 -1
- package/docs/zh/architecture.md +11 -6
- package/docs/zh/benchmarks.md +8 -8
- package/docs/zh/capabilities.md +3 -1
- package/docs/zh/release-checklist.md +2 -2
- package/docs/zh/roadmap.md +19 -1
- package/package.json +1 -1
- package/dist/chunk-L24ETFVK.js.map +0 -7
|
@@ -5132,8 +5132,8 @@ var CentrifugeSession = class {
|
|
|
5132
5132
|
// Route credential fetches back to the main thread, where the
|
|
5133
5133
|
// application's credentialProvider lives (config must stay
|
|
5134
5134
|
// structured-cloneable, so functions cannot cross the boundary).
|
|
5135
|
-
getToken: () => this.requestToken("token"),
|
|
5136
|
-
getChannelToken: (channel) => this.requestToken("channelToken", channel)
|
|
5135
|
+
getToken: () => this.requestToken("token", lifecycle),
|
|
5136
|
+
getChannelToken: (channel) => this.requestToken("channelToken", lifecycle, channel)
|
|
5137
5137
|
} : config;
|
|
5138
5138
|
const client = new Centrifuge(url, clientOptions);
|
|
5139
5139
|
this.client = client;
|
|
@@ -5252,15 +5252,13 @@ var CentrifugeSession = class {
|
|
|
5252
5252
|
/** Issue a credential request to the main thread and await the response.
|
|
5253
5253
|
* Used as Centrifuge's `getToken` / `getChannelToken` when token bridging is
|
|
5254
5254
|
* enabled; resolved or rejected by a matching TOKEN_RESPONSE / TOKEN_ERROR. */
|
|
5255
|
-
requestToken(kind, channel) {
|
|
5256
|
-
|
|
5255
|
+
requestToken(kind, lifecycle, channel) {
|
|
5256
|
+
if (this.lifecycle !== lifecycle) {
|
|
5257
|
+
return Promise.reject(new Error("Centrifuge client lifecycle has ended before the credential was requested."));
|
|
5258
|
+
}
|
|
5257
5259
|
const requestId = this.nextRequestId;
|
|
5258
5260
|
this.nextRequestId += 1;
|
|
5259
5261
|
return new Promise((resolve, reject) => {
|
|
5260
|
-
if (this.lifecycle !== lifecycle) {
|
|
5261
|
-
reject(new Error("Centrifuge session stopped before the credential was requested."));
|
|
5262
|
-
return;
|
|
5263
|
-
}
|
|
5264
5262
|
this.pendingTokenRequests.set(requestId, { resolve, reject });
|
|
5265
5263
|
this.post({
|
|
5266
5264
|
type: CENTRIFUGE_OUTPUT_TYPE.TOKEN_REQUEST,
|