@shushed/helpers 0.0.62 → 0.0.64
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/index.js +13 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1067,9 +1067,12 @@ var PubSubHelper = class extends Runtime {
|
|
|
1067
1067
|
retryMaxDelay: 360,
|
|
1068
1068
|
ackDeadline: 90
|
|
1069
1069
|
};
|
|
1070
|
-
this.logging.log("updateSubscription called with", subscriptionName, subscription, subscriptionMetaData, inputOpts);
|
|
1070
|
+
this.logging.log("updateSubscription called with", subscriptionName, !!subscription, subscriptionMetaData, inputOpts);
|
|
1071
1071
|
const opts = Object.assign({}, defaultOptions, inputOpts);
|
|
1072
|
-
this.logging.log("updateSubscription final opts", opts
|
|
1072
|
+
this.logging.log("updateSubscription final opts", Object.assign({}, opts, {
|
|
1073
|
+
topic: opts.topic.name,
|
|
1074
|
+
dlqTopic: opts.dlqTopic?.name
|
|
1075
|
+
}));
|
|
1073
1076
|
let nextMetadata = null;
|
|
1074
1077
|
if (isSubscriptionOptionsPush(opts)) {
|
|
1075
1078
|
if (opts.endpointUrl !== subscriptionMetaData?.pushConfig?.pushEndpoint || this.serviceAccountEmail !== subscriptionMetaData?.pushConfig.oidcToken?.serviceAccountEmail || process.env.GCLOUD_PROJECT + "/" + this.triggerId !== subscriptionMetaData.pushConfig.oidcToken.audience) {
|
|
@@ -1090,6 +1093,7 @@ var PubSubHelper = class extends Runtime {
|
|
|
1090
1093
|
}
|
|
1091
1094
|
});
|
|
1092
1095
|
} catch (err) {
|
|
1096
|
+
this.logging.error("Invariant: While updating push subscription", err.message, err.stack);
|
|
1093
1097
|
throw new Error("Invariant: While updating push subscription - " + err.message);
|
|
1094
1098
|
}
|
|
1095
1099
|
} else {
|
|
@@ -1104,8 +1108,10 @@ var PubSubHelper = class extends Runtime {
|
|
|
1104
1108
|
}
|
|
1105
1109
|
}
|
|
1106
1110
|
} else {
|
|
1107
|
-
|
|
1108
|
-
|
|
1111
|
+
if (subscriptionMetaData?.pushConfig?.pushEndpoint) {
|
|
1112
|
+
nextMetadata = nextMetadata || {};
|
|
1113
|
+
nextMetadata.pushConfig = null;
|
|
1114
|
+
}
|
|
1109
1115
|
}
|
|
1110
1116
|
if (opts.dlqTopic) {
|
|
1111
1117
|
if (opts.dlqTopic.name !== subscriptionMetaData?.deadLetterPolicy?.deadLetterTopic || opts.retryLimit !== subscriptionMetaData?.deadLetterPolicy.maxDeliveryAttempts) {
|
|
@@ -1116,11 +1122,10 @@ var PubSubHelper = class extends Runtime {
|
|
|
1116
1122
|
};
|
|
1117
1123
|
}
|
|
1118
1124
|
} else if (subscriptionMetaData?.deadLetterPolicy?.deadLetterTopic) {
|
|
1119
|
-
nextMetadata = nextMetadata || {
|
|
1120
|
-
|
|
1121
|
-
};
|
|
1125
|
+
nextMetadata = nextMetadata || {};
|
|
1126
|
+
nextMetadata.deadLetterPolicy = null;
|
|
1122
1127
|
}
|
|
1123
|
-
if (opts.retryMinDelay
|
|
1128
|
+
if (opts.retryMinDelay != subscriptionMetaData?.retryPolicy?.minimumBackoff?.seconds || opts.retryMaxDelay != subscriptionMetaData?.retryPolicy?.maximumBackoff?.seconds) {
|
|
1124
1129
|
nextMetadata = nextMetadata || {};
|
|
1125
1130
|
nextMetadata.retryPolicy = {
|
|
1126
1131
|
minimumBackoff: { seconds: opts.retryMinDelay },
|