@kumori/aurora-backend-handler 1.0.66 → 1.0.67
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/helpers/revision-helper.ts +23 -17
- package/package.json +1 -1
- package/websocket-manager.ts +1 -0
|
@@ -256,33 +256,39 @@ const updateServiceWithRevision = (
|
|
|
256
256
|
const incomingStatus = eventData.status.state;
|
|
257
257
|
const incomingTs = getTimestamp(incomingStatus.timestamp);
|
|
258
258
|
const currentTs = getTimestamp(existingService.status?.timestamp);
|
|
259
|
+
const incomingRevisionId = Number(entityId);
|
|
260
|
+
const currentRevisionId = Number(existingService.currentRevision ?? 0);
|
|
259
261
|
|
|
260
262
|
if (incomingTs > currentTs) {
|
|
261
263
|
updatedService.status = incomingStatus;
|
|
262
264
|
if (eventData.status.error) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
if (incomingRevisionId >= currentRevisionId) {
|
|
266
|
+
updatedService.error = {
|
|
267
|
+
code: eventData.status.error.code,
|
|
268
|
+
message: eventData.status.error.message,
|
|
269
|
+
timestamp:
|
|
270
|
+
eventData.status.error.timestamp || incomingStatus.timestamp,
|
|
271
|
+
};
|
|
272
|
+
deploymentErrorEvent = updatedService;
|
|
273
|
+
}
|
|
269
274
|
} else {
|
|
270
275
|
updatedService.error = undefined;
|
|
271
276
|
}
|
|
272
277
|
} else if (eventData.status.error) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
if (incomingRevisionId >= currentRevisionId) {
|
|
279
|
+
const incomingErrorTs = getTimestamp(eventData.status.error.timestamp);
|
|
280
|
+
const currentErrorTs = getTimestamp(existingService.error?.timestamp);
|
|
281
|
+
if (incomingErrorTs > currentErrorTs) {
|
|
282
|
+
updatedService.error = {
|
|
283
|
+
code: eventData.status.error.code,
|
|
284
|
+
message: eventData.status.error.message,
|
|
285
|
+
timestamp: eventData.status.error.timestamp,
|
|
286
|
+
};
|
|
287
|
+
deploymentErrorEvent = updatedService;
|
|
288
|
+
}
|
|
282
289
|
}
|
|
283
290
|
}
|
|
284
|
-
|
|
285
|
-
const currentRevisionId = Number(existingService.currentRevision ?? 0);
|
|
291
|
+
|
|
286
292
|
if (incomingRevisionId >= currentRevisionId && !eventData.status.error) {
|
|
287
293
|
updatedService.error = undefined;
|
|
288
294
|
}
|
package/package.json
CHANGED
package/websocket-manager.ts
CHANGED
|
@@ -751,6 +751,7 @@ const handleEvent = async (message: WSMessage) => {
|
|
|
751
751
|
servicesMap.set(serviceResult.serviceFullKey, savedService);
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
|
+
|
|
754
755
|
const projectLabel = eventData.meta?.labels?.project;
|
|
755
756
|
if (projectLabel) {
|
|
756
757
|
const tenant = tenantsMap.get(parentParts.tenant);
|