@kumori/aurora-backend-handler 1.0.65 → 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 +4 -4
|
@@ -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
|
@@ -744,14 +744,14 @@ const handleEvent = async (message: WSMessage) => {
|
|
|
744
744
|
|
|
745
745
|
const savedService = servicesMap.get(serviceResult.serviceFullKey)!;
|
|
746
746
|
if (savedService.error && savedService.currentRevision) {
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
)
|
|
750
|
-
if (currentRev && !currentRev.errorCode) {
|
|
747
|
+
const currentRevId = Number(savedService.currentRevision);
|
|
748
|
+
const errorTs = Number(savedService.error.timestamp ?? 0);
|
|
749
|
+
if (currentRevId > errorTs) {
|
|
751
750
|
savedService.error = undefined;
|
|
752
751
|
servicesMap.set(serviceResult.serviceFullKey, savedService);
|
|
753
752
|
}
|
|
754
753
|
}
|
|
754
|
+
|
|
755
755
|
const projectLabel = eventData.meta?.labels?.project;
|
|
756
756
|
if (projectLabel) {
|
|
757
757
|
const tenant = tenantsMap.get(parentParts.tenant);
|