@resolveio/server-lib 4.4.9 → 4.4.10

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.
@@ -510,7 +510,7 @@ var SubscriptionManager = /** @class */ (function () {
510
510
  var _this = this;
511
511
  var that = this;
512
512
  setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
513
- var uniqueOplog_1, uniquePubs, needIds_1, _loop_3, i, i, oplog, _loop_4, j, state_1;
513
+ var uniqueOplog_1, uniquePubs, needIds_1, _loop_3, i, _loop_4, i, i, oplog, _loop_5, j, state_1;
514
514
  var _this = this;
515
515
  return __generator(this, function (_a) {
516
516
  switch (_a.label) {
@@ -520,6 +520,14 @@ var SubscriptionManager = /** @class */ (function () {
520
520
  this._oplogQueue = [];
521
521
  uniquePubs = [];
522
522
  needIds_1 = {};
523
+ _loop_3 = function (i) {
524
+ if (!that._subscriptions.some(function (a) { return a.collections.includes(uniqueOplog_1[i].collection); })) {
525
+ uniqueOplog_1.splice(i, 1);
526
+ }
527
+ };
528
+ for (i = uniqueOplog_1.length - 1; i >= 0; i--) {
529
+ _loop_3(i);
530
+ }
523
531
  uniqueOplog_1.forEach(function (oplog) {
524
532
  var schemaErrors = null;
525
533
  try {
@@ -539,7 +547,7 @@ var SubscriptionManager = /** @class */ (function () {
539
547
  }
540
548
  }
541
549
  });
542
- _loop_3 = function (i) {
550
+ _loop_4 = function (i) {
543
551
  var collection, docs;
544
552
  return __generator(this, function (_a) {
545
553
  switch (_a.label) {
@@ -564,7 +572,7 @@ var SubscriptionManager = /** @class */ (function () {
564
572
  _a.label = 1;
565
573
  case 1:
566
574
  if (!(i < Object.keys(needIds_1).length)) return [3 /*break*/, 4];
567
- return [5 /*yield**/, _loop_3(i)];
575
+ return [5 /*yield**/, _loop_4(i)];
568
576
  case 2:
569
577
  _a.sent();
570
578
  _a.label = 3;
@@ -577,7 +585,7 @@ var SubscriptionManager = /** @class */ (function () {
577
585
  case 5:
578
586
  if (!(i >= 0)) return [3 /*break*/, 10];
579
587
  oplog = uniqueOplog_1[i];
580
- _loop_4 = function (j) {
588
+ _loop_5 = function (j) {
581
589
  var _a, sub, _b;
582
590
  return __generator(this, function (_c) {
583
591
  switch (_c.label) {
@@ -644,7 +652,7 @@ var SubscriptionManager = /** @class */ (function () {
644
652
  _a.label = 6;
645
653
  case 6:
646
654
  if (!(j < that._subscriptions.length)) return [3 /*break*/, 9];
647
- return [5 /*yield**/, _loop_4(j)];
655
+ return [5 /*yield**/, _loop_5(j)];
648
656
  case 7:
649
657
  state_1 = _a.sent();
650
658
  if (state_1 === "break")
@@ -688,12 +696,12 @@ var SubscriptionManager = /** @class */ (function () {
688
696
  // Check to see if any pubs need to refetch due to Mongo operation
689
697
  SubscriptionManager.prototype.checkPubsForChanges = function (collection, document, type) {
690
698
  return __awaiter(this, void 0, void 0, function () {
691
- var that, _loop_5, i;
699
+ var that, _loop_6, i;
692
700
  return __generator(this, function (_a) {
693
701
  switch (_a.label) {
694
702
  case 0:
695
703
  that = this;
696
- _loop_5 = function (i) {
704
+ _loop_6 = function (i) {
697
705
  var _a, _b, sub, _c, _d;
698
706
  return __generator(this, function (_e) {
699
707
  switch (_e.label) {
@@ -759,7 +767,7 @@ var SubscriptionManager = /** @class */ (function () {
759
767
  _a.label = 1;
760
768
  case 1:
761
769
  if (!(i < that._subscriptions.filter(function (a) { return a.collections.includes(collection); }).length)) return [3 /*break*/, 4];
762
- return [5 /*yield**/, _loop_5(i)];
770
+ return [5 /*yield**/, _loop_6(i)];
763
771
  case 2:
764
772
  _a.sent();
765
773
  _a.label = 3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resolveio/server-lib",
3
- "version": "4.4.9",
3
+ "version": "4.4.10",
4
4
  "description": "",
5
5
  "main": "index.ts",
6
6
  "scripts": {