@resolveio/server-lib 5.0.13 → 5.0.14

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.
@@ -964,9 +964,11 @@ var SubscriptionManager = /** @class */ (function () {
964
964
  // console.log('Cache1: ' + 'Too Big - ' + subscription.publication + ' - ' + getBinarySize(JSON.stringify(this._subCache)));
965
965
  _this._subCache.splice(0, neededSizeIndex);
966
966
  }
967
- var cacheId = _this._cacheId++;
968
- _this._nodeCache.set(cacheId, res);
969
- _this._subCache.push({ collection: collection, publication: subscription.publication, subscriptionData: subscription.subscriptionData, id: cacheId });
967
+ if (!_this._subCache.some(function (a) { return a.collection === collection && a.publication === subscription.publication && JSON.stringify(a.subscriptionData) === JSON.stringify(subscription.subscriptionData); })) {
968
+ var cacheId = _this._cacheId++;
969
+ _this._nodeCache.set(cacheId, res);
970
+ _this._subCache.push({ collection: collection, publication: subscription.publication, subscriptionData: subscription.subscriptionData, id: cacheId });
971
+ }
970
972
  // console.log('Cache1: ' + 'Create - ' + subscription.publication + ' - ' + getBinarySize(JSON.stringify(this._subCache)));
971
973
  var serverRes = {
972
974
  messageId: messageId,
@@ -1047,9 +1049,11 @@ var SubscriptionManager = /** @class */ (function () {
1047
1049
  // console.log('Cache: ' + 'Too Big - ' + subscription.publication + ' - ' + getBinarySize(JSON.stringify(this._subCache)));
1048
1050
  _this._subCache.splice(0, neededSizeIndex);
1049
1051
  }
1050
- var cacheId = _this._cacheId++;
1051
- _this._nodeCache.set(cacheId, res);
1052
- _this._subCache.push({ collection: collection, publication: subscription.publication, subscriptionData: subscription.subscriptionData, id: cacheId });
1052
+ if (!_this._subCache.some(function (a) { return a.collection === collection && a.publication === subscription.publication && JSON.stringify(a.subscriptionData) === JSON.stringify(subscription.subscriptionData); })) {
1053
+ var cacheId = _this._cacheId++;
1054
+ _this._nodeCache.set(cacheId, res);
1055
+ _this._subCache.push({ collection: collection, publication: subscription.publication, subscriptionData: subscription.subscriptionData, id: cacheId });
1056
+ }
1053
1057
  // console.log('Cache: ' + 'Create - ' + subscription.publication + ' - ' + getBinarySize(JSON.stringify(this._subCache)));
1054
1058
  subscription.clients.forEach(function (client) {
1055
1059
  that._wss.clients.forEach(function (ws) {
@@ -544,9 +544,6 @@ function loadReportBuilderMethods(methodManager) {
544
544
  $sort: rootOptions.sort
545
545
  });
546
546
  }
547
- console.log('_____________ query __________');
548
- console.log(query);
549
- console.log(JSON.stringify(query, null, 2));
550
547
  res = null;
551
548
  _a.label = 1;
552
549
  case 1:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "5.0.13",
3
+ "version": "5.0.14",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {