@resolveio/server-lib 4.4.5 → 4.4.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.
|
@@ -584,11 +584,12 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
584
584
|
if (!(i >= 0)) return [3 /*break*/, 10];
|
|
585
585
|
oplog = uniqueOplog_1[i];
|
|
586
586
|
_loop_4 = function (j) {
|
|
587
|
-
var _a, sub,
|
|
588
|
-
return __generator(this, function (
|
|
589
|
-
switch (
|
|
587
|
+
var _a, _b, sub, _c;
|
|
588
|
+
return __generator(this, function (_d) {
|
|
589
|
+
switch (_d.label) {
|
|
590
590
|
case 0:
|
|
591
591
|
sub = that._subscriptions[j];
|
|
592
|
+
if (!(oplog.type === 'update')) return [3 /*break*/, 4];
|
|
592
593
|
if (!sub.collections.includes(oplog.collection)) return [3 /*break*/, 3];
|
|
593
594
|
if (sub.preSubscriptionData) {
|
|
594
595
|
if (that._publications[sub.publication].fetchFunction(oplog.doc, sub.preSubscriptionData)) {
|
|
@@ -602,10 +603,10 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
602
603
|
}
|
|
603
604
|
}
|
|
604
605
|
if (!that._publications[sub.publication].preFunction) return [3 /*break*/, 2];
|
|
605
|
-
|
|
606
|
+
_c = sub;
|
|
606
607
|
return [4 /*yield*/, that._publications[sub.publication].preFunction(sub.subscriptionData)];
|
|
607
608
|
case 1:
|
|
608
|
-
|
|
609
|
+
_c.preSubscriptionData = _d.sent();
|
|
609
610
|
if (that._publications[sub.publication].fetchFunction(oplog.doc, sub.preSubscriptionData)) {
|
|
610
611
|
if (!uniquePubs.filter(function (a) { return a.publication === sub.publication && JSON.stringify(a.subscriptionData) === JSON.stringify(sub.subscriptionData); }).length) {
|
|
611
612
|
uniquePubs.push(sub);
|
|
@@ -637,8 +638,22 @@ var SubscriptionManager = /** @class */ (function () {
|
|
|
637
638
|
}
|
|
638
639
|
return [2 /*return*/, "break"];
|
|
639
640
|
}
|
|
640
|
-
|
|
641
|
-
case 3: return [
|
|
641
|
+
_d.label = 3;
|
|
642
|
+
case 3: return [3 /*break*/, 5];
|
|
643
|
+
case 4:
|
|
644
|
+
if (oplog.type === 'insert') {
|
|
645
|
+
if (sub.collections.includes(oplog.collection) && (that._publications[sub.publication].preFunction || !that._publications[sub.publication].fetchFunction || (_b = that._publications[sub.publication]).fetchFunction.apply(_b, [oplog.doc].concat(sub.subscriptionData)))) {
|
|
646
|
+
if (!uniquePubs.filter(function (a) { return a.publication === sub.publication && JSON.stringify(a.subscriptionData) === JSON.stringify(sub.subscriptionData); }).length) {
|
|
647
|
+
uniquePubs.push(sub);
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
uniqueOplog_1.splice(i, 1);
|
|
651
|
+
}
|
|
652
|
+
return [2 /*return*/, "break"];
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
_d.label = 5;
|
|
656
|
+
case 5: return [2 /*return*/];
|
|
642
657
|
}
|
|
643
658
|
});
|
|
644
659
|
};
|