@friggframework/core 2.0.0-next.76 → 2.0.0-next.77
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/handlers/backend-utils.js +25 -0
- package/package.json +5 -5
|
@@ -154,6 +154,12 @@ const createQueueWorker = (integrationClass) => {
|
|
|
154
154
|
params.data.processId,
|
|
155
155
|
integrationClass
|
|
156
156
|
);
|
|
157
|
+
if (integrationInstance?.status === 'DISABLED') {
|
|
158
|
+
console.warn(
|
|
159
|
+
`[${integrationClass.Definition.name}] Integration for process ${params.data.processId} is DISABLED. Discarding ${params.event} message.`
|
|
160
|
+
);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
157
163
|
} else if (params.data?.integrationId) {
|
|
158
164
|
integrationInstance = await loadIntegrationForWebhook(
|
|
159
165
|
params.data.integrationId
|
|
@@ -164,6 +170,12 @@ const createQueueWorker = (integrationClass) => {
|
|
|
164
170
|
);
|
|
165
171
|
return;
|
|
166
172
|
}
|
|
173
|
+
if (integrationInstance.status === 'DISABLED') {
|
|
174
|
+
console.warn(
|
|
175
|
+
`[${integrationClass.Definition.name}] Integration ${params.data.integrationId} is DISABLED. Discarding ${params.event} message.`
|
|
176
|
+
);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
167
179
|
} else {
|
|
168
180
|
// Instantiates a DRY integration class without database records.
|
|
169
181
|
// There will be cases where we need to use helpers that the api modules can export.
|
|
@@ -186,6 +198,19 @@ const createQueueWorker = (integrationClass) => {
|
|
|
186
198
|
`Error in ${params.event} for ${integrationClass.Definition.name}:`,
|
|
187
199
|
error
|
|
188
200
|
);
|
|
201
|
+
|
|
202
|
+
// 4xx HTTP errors are permanent — the requester already
|
|
203
|
+
// attempted token refresh (401) and backoff (429/5xx).
|
|
204
|
+
// By the time a 4xx reaches here, retrying won't help.
|
|
205
|
+
// 408 (timeout) and 429 (rate limit) are excluded — both are transient.
|
|
206
|
+
const status = error.statusCode;
|
|
207
|
+
if (status && status >= 400 && status < 500 && status !== 408 && status !== 429) {
|
|
208
|
+
error.isHaltError = true;
|
|
209
|
+
console.warn(
|
|
210
|
+
`[${integrationClass.Definition.name}] Permanent ${status} error for ${params.event} — message will be discarded (no retry)`
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
189
214
|
throw error;
|
|
190
215
|
}
|
|
191
216
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0-next.
|
|
4
|
+
"version": "2.0.0-next.77",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@friggframework/eslint-config": "2.0.0-next.
|
|
42
|
-
"@friggframework/prettier-config": "2.0.0-next.
|
|
43
|
-
"@friggframework/test": "2.0.0-next.
|
|
41
|
+
"@friggframework/eslint-config": "2.0.0-next.77",
|
|
42
|
+
"@friggframework/prettier-config": "2.0.0-next.77",
|
|
43
|
+
"@friggframework/test": "2.0.0-next.77",
|
|
44
44
|
"@prisma/client": "^6.17.0",
|
|
45
45
|
"@types/lodash": "4.17.15",
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "0f451bd5c8493b4ec6f82964a976cf2533aa94d8"
|
|
84
84
|
}
|