@interopio/browser 4.1.5 → 4.1.6
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/dist/browser.es.js +39 -23
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.umd.js +39 -23
- package/dist/browser.umd.js.map +1 -1
- package/dist/browser.umd.min.js +1 -1
- package/package.json +6 -6
package/dist/browser.umd.js
CHANGED
|
@@ -7744,7 +7744,7 @@
|
|
|
7744
7744
|
}
|
|
7745
7745
|
}
|
|
7746
7746
|
|
|
7747
|
-
var version$1 = "4.1.
|
|
7747
|
+
var version$1 = "4.1.6";
|
|
7748
7748
|
|
|
7749
7749
|
const setupGlobalSystem = (io, bridge) => {
|
|
7750
7750
|
return {
|
|
@@ -10784,7 +10784,7 @@
|
|
|
10784
10784
|
}
|
|
10785
10785
|
};
|
|
10786
10786
|
|
|
10787
|
-
var version = "6.7.
|
|
10787
|
+
var version = "6.7.3";
|
|
10788
10788
|
|
|
10789
10789
|
function prepareConfig (configuration, ext, glue42gd) {
|
|
10790
10790
|
let nodeStartingContext;
|
|
@@ -10987,6 +10987,7 @@
|
|
|
10987
10987
|
contextId;
|
|
10988
10988
|
context;
|
|
10989
10989
|
isAnnounced;
|
|
10990
|
+
createdByUs;
|
|
10990
10991
|
joinedActivity;
|
|
10991
10992
|
updateCallbacks = {};
|
|
10992
10993
|
activityId;
|
|
@@ -13050,6 +13051,9 @@
|
|
|
13050
13051
|
contextData.hasReceivedSnapshot = true;
|
|
13051
13052
|
this._contextNameToData[name] = contextData;
|
|
13052
13053
|
delete this._creationPromises[name];
|
|
13054
|
+
contextData.sentExplicitSubscription = true;
|
|
13055
|
+
contextData.createdByUs = true;
|
|
13056
|
+
this.subscribe(name, () => { });
|
|
13053
13057
|
return createContextMsg.context_id;
|
|
13054
13058
|
});
|
|
13055
13059
|
return this._creationPromises[name];
|
|
@@ -13070,10 +13074,7 @@
|
|
|
13070
13074
|
await this.createContext(name, delta);
|
|
13071
13075
|
return;
|
|
13072
13076
|
}
|
|
13073
|
-
|
|
13074
|
-
if (!contextData.hasReceivedSnapshot) {
|
|
13075
|
-
currentContext = await this.get(contextData.name);
|
|
13076
|
-
}
|
|
13077
|
+
const currentContext = await this.get(contextData.name);
|
|
13077
13078
|
const calculatedDelta = this.setPathSupported ?
|
|
13078
13079
|
this.calculateContextDeltaV2(currentContext, delta) :
|
|
13079
13080
|
this.calculateContextDeltaV1(currentContext, delta);
|
|
@@ -13095,7 +13096,8 @@
|
|
|
13095
13096
|
!contextData.activityId) {
|
|
13096
13097
|
this.subscribe(name, () => { });
|
|
13097
13098
|
}
|
|
13098
|
-
if (
|
|
13099
|
+
if (this._subscribeOnUpdate ||
|
|
13100
|
+
contextData.sentExplicitSubscription ||
|
|
13099
13101
|
contextData.activityId) {
|
|
13100
13102
|
await contextData.snapshotPromise;
|
|
13101
13103
|
this.handleUpdated(contextData, calculatedDelta, {
|
|
@@ -13114,14 +13116,21 @@
|
|
|
13114
13116
|
if (!contextData || !contextData.isAnnounced) {
|
|
13115
13117
|
return this.createContext(name, data);
|
|
13116
13118
|
}
|
|
13117
|
-
await this._gw3Session
|
|
13119
|
+
const gwResponse = await this._gw3Session
|
|
13118
13120
|
.send({
|
|
13119
13121
|
type: GW_MESSAGE_UPDATE_CONTEXT,
|
|
13120
13122
|
domain: "global",
|
|
13121
13123
|
context_id: contextData.contextId,
|
|
13122
13124
|
delta: { reset: data },
|
|
13123
|
-
}, {}, { skipPeerId: false })
|
|
13124
|
-
|
|
13125
|
+
}, {}, { skipPeerId: false });
|
|
13126
|
+
if (this._subscribeOnUpdate &&
|
|
13127
|
+
!contextData.sentExplicitSubscription &&
|
|
13128
|
+
!contextData.activityId) {
|
|
13129
|
+
this.subscribe(name, () => { });
|
|
13130
|
+
}
|
|
13131
|
+
if (this._subscribeOnUpdate ||
|
|
13132
|
+
contextData.sentExplicitSubscription ||
|
|
13133
|
+
contextData.activityId) {
|
|
13125
13134
|
this.handleUpdated(contextData, {
|
|
13126
13135
|
reset: data,
|
|
13127
13136
|
added: {},
|
|
@@ -13130,7 +13139,7 @@
|
|
|
13130
13139
|
}, {
|
|
13131
13140
|
updaterId: gwResponse.peer_id
|
|
13132
13141
|
});
|
|
13133
|
-
}
|
|
13142
|
+
}
|
|
13134
13143
|
}
|
|
13135
13144
|
setPath(name, path, value) {
|
|
13136
13145
|
if (!this.setPathSupported) {
|
|
@@ -13177,7 +13186,8 @@
|
|
|
13177
13186
|
!contextData.activityId) {
|
|
13178
13187
|
this.subscribe(name, () => { });
|
|
13179
13188
|
}
|
|
13180
|
-
if (
|
|
13189
|
+
if (this._subscribeOnUpdate ||
|
|
13190
|
+
contextData.sentExplicitSubscription ||
|
|
13181
13191
|
contextData.activityId) {
|
|
13182
13192
|
await contextData.snapshotPromise;
|
|
13183
13193
|
this.handleUpdated(contextData, {
|
|
@@ -13196,9 +13206,12 @@
|
|
|
13196
13206
|
}
|
|
13197
13207
|
const contextData = this._contextNameToData[name];
|
|
13198
13208
|
if (!contextData || !contextData.isAnnounced) {
|
|
13209
|
+
if (!contextData && this._subscribeOnGet) {
|
|
13210
|
+
this.subscribe(name, () => { });
|
|
13211
|
+
}
|
|
13199
13212
|
return Promise.resolve({});
|
|
13200
13213
|
}
|
|
13201
|
-
if (contextData &&
|
|
13214
|
+
if (contextData && !contextData.sentExplicitSubscription) {
|
|
13202
13215
|
return new Promise((resolve, reject) => {
|
|
13203
13216
|
this.subscribe(name, (data, _d, _r, un) => {
|
|
13204
13217
|
if (!this._subscribeOnGet) {
|
|
@@ -13229,8 +13242,6 @@
|
|
|
13229
13242
|
const thisCallbackSubscriptionNumber = typeof subscriptionKey === "undefined" ? this._nextCallbackSubscriptionNumber : subscriptionKey;
|
|
13230
13243
|
if (typeof subscriptionKey === "undefined") {
|
|
13231
13244
|
this._nextCallbackSubscriptionNumber += 1;
|
|
13232
|
-
}
|
|
13233
|
-
if (this._contextsSubscriptionsCache.every((subscription) => subscription.subKey !== this._nextCallbackSubscriptionNumber)) {
|
|
13234
13245
|
this._contextsSubscriptionsCache.push({ contextName: name, subKey: thisCallbackSubscriptionNumber, callback });
|
|
13235
13246
|
}
|
|
13236
13247
|
let contextData = this._contextNameToData[name];
|
|
@@ -13244,19 +13255,22 @@
|
|
|
13244
13255
|
const hadCallbacks = contextData.hasCallbacks();
|
|
13245
13256
|
contextData.updateCallbacks[thisCallbackSubscriptionNumber] = callback;
|
|
13246
13257
|
if (!hadCallbacks) {
|
|
13247
|
-
if (!contextData.joinedActivity) {
|
|
13258
|
+
if (!contextData.joinedActivity && !contextData.createdByUs) {
|
|
13248
13259
|
if (contextData.context && contextData.sentExplicitSubscription) {
|
|
13249
|
-
if (contextData.hasReceivedSnapshot) {
|
|
13260
|
+
if (contextData.hasReceivedSnapshot && !subscriptionKey) {
|
|
13250
13261
|
const clone = deepClone(contextData.context);
|
|
13251
13262
|
callback(clone, clone, [], thisCallbackSubscriptionNumber);
|
|
13252
13263
|
}
|
|
13253
13264
|
return Promise.resolve(thisCallbackSubscriptionNumber);
|
|
13254
13265
|
}
|
|
13255
13266
|
return this.sendSubscribe(contextData)
|
|
13256
|
-
.then(() => thisCallbackSubscriptionNumber)
|
|
13267
|
+
.then(() => thisCallbackSubscriptionNumber, () => {
|
|
13268
|
+
this.unsubscribe(thisCallbackSubscriptionNumber, true);
|
|
13269
|
+
return thisCallbackSubscriptionNumber;
|
|
13270
|
+
});
|
|
13257
13271
|
}
|
|
13258
13272
|
else {
|
|
13259
|
-
if (contextData.hasReceivedSnapshot) {
|
|
13273
|
+
if (contextData.hasReceivedSnapshot && !subscriptionKey) {
|
|
13260
13274
|
const clone = deepClone(contextData.context);
|
|
13261
13275
|
callback(clone, clone, [], thisCallbackSubscriptionNumber);
|
|
13262
13276
|
}
|
|
@@ -13264,14 +13278,17 @@
|
|
|
13264
13278
|
}
|
|
13265
13279
|
}
|
|
13266
13280
|
else {
|
|
13267
|
-
if (contextData.hasReceivedSnapshot) {
|
|
13281
|
+
if (contextData.hasReceivedSnapshot && !subscriptionKey) {
|
|
13268
13282
|
const clone = deepClone(contextData.context);
|
|
13269
13283
|
callback(clone, clone, [], thisCallbackSubscriptionNumber);
|
|
13270
13284
|
}
|
|
13271
13285
|
return Promise.resolve(thisCallbackSubscriptionNumber);
|
|
13272
13286
|
}
|
|
13273
13287
|
}
|
|
13274
|
-
unsubscribe(subscriptionKey) {
|
|
13288
|
+
unsubscribe(subscriptionKey, keepInSubscriptionsCache) {
|
|
13289
|
+
if (!keepInSubscriptionsCache) {
|
|
13290
|
+
this._contextsSubscriptionsCache = this._contextsSubscriptionsCache.filter(x => x.subKey !== subscriptionKey);
|
|
13291
|
+
}
|
|
13275
13292
|
for (const name of Object.keys(this._contextNameToData)) {
|
|
13276
13293
|
const contextData = this._contextNameToData[name];
|
|
13277
13294
|
if (!contextData) {
|
|
@@ -13316,7 +13333,6 @@
|
|
|
13316
13333
|
handleUpdated(contextData, delta, extraData) {
|
|
13317
13334
|
const oldContext = contextData.context;
|
|
13318
13335
|
contextData.context = applyContextDelta(contextData.context, delta, this._logger);
|
|
13319
|
-
contextData.hasReceivedSnapshot = true;
|
|
13320
13336
|
if (this._contextNameToData[contextData.name] === contextData &&
|
|
13321
13337
|
!deepEqual(oldContext, contextData.context)) {
|
|
13322
13338
|
this.invokeUpdateCallbacks(contextData, delta, extraData);
|
|
@@ -13583,7 +13599,7 @@
|
|
|
13583
13599
|
this._connection.off(sub);
|
|
13584
13600
|
}
|
|
13585
13601
|
if (this._systemContextsSubKey) {
|
|
13586
|
-
this.unsubscribe(this._systemContextsSubKey);
|
|
13602
|
+
this.unsubscribe(this._systemContextsSubKey, true);
|
|
13587
13603
|
delete this._systemContextsSubKey;
|
|
13588
13604
|
}
|
|
13589
13605
|
this._gw3Subscriptions = [];
|