@friggframework/core 2.0.0-next.89 → 2.0.0-next.90
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 +29 -0
- package/package.json +5 -5
|
@@ -110,6 +110,22 @@ const loadIntegrationForWebhook = async (integrationId) => {
|
|
|
110
110
|
return instance;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
// Returns false only when the integration is confirmed gone; a transient
|
|
114
|
+
// lookup failure returns true so genuine errors keep their normal retry path.
|
|
115
|
+
const integrationExists = async (integrationId) => {
|
|
116
|
+
const integrationRepository = createIntegrationRepository();
|
|
117
|
+
try {
|
|
118
|
+
const record =
|
|
119
|
+
await integrationRepository.findIntegrationById(integrationId);
|
|
120
|
+
return Boolean(record);
|
|
121
|
+
} catch (error) {
|
|
122
|
+
if (error.message?.includes('not found')) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
113
129
|
const loadIntegrationForProcess = async (processId, integrationClass) => {
|
|
114
130
|
|
|
115
131
|
const { processRepository, integrationRepository, moduleRepository } =
|
|
@@ -233,6 +249,18 @@ const createQueueWorker = (integrationClass) => {
|
|
|
233
249
|
console.log(`[QueueWorker] ${params.event} dispatched ok`, logCtx);
|
|
234
250
|
return result;
|
|
235
251
|
} catch (error) {
|
|
252
|
+
// Integration deleted mid-flight: no retry can succeed once
|
|
253
|
+
// it's gone, so discard instead of sending it to the DLQ.
|
|
254
|
+
if (
|
|
255
|
+
params.data?.integrationId &&
|
|
256
|
+
!(await integrationExists(params.data.integrationId))
|
|
257
|
+
) {
|
|
258
|
+
console.warn(
|
|
259
|
+
`[${integrationName}] Integration ${params.data.integrationId} was deleted mid-flight — discarding ${params.event} message (no retry)`
|
|
260
|
+
);
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
|
|
236
264
|
console.error(
|
|
237
265
|
`Error in ${params.event} for ${integrationName}:`,
|
|
238
266
|
error
|
|
@@ -265,4 +293,5 @@ const createQueueWorker = (integrationClass) => {
|
|
|
265
293
|
module.exports = {
|
|
266
294
|
loadRouterFromObject,
|
|
267
295
|
createQueueWorker,
|
|
296
|
+
integrationExists,
|
|
268
297
|
};
|
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.90",
|
|
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.90",
|
|
42
|
+
"@friggframework/prettier-config": "2.0.0-next.90",
|
|
43
|
+
"@friggframework/test": "2.0.0-next.90",
|
|
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": "d3860adced774b5622c12d48ee6e1f3a794f2a8c"
|
|
84
84
|
}
|