@kumori/aurora-backend-handler 1.0.81 → 1.0.83

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/aurora-backend-handler",
3
- "version": "1.0.81",
3
+ "version": "1.0.83",
4
4
  "description": "backend handler",
5
5
  "main": "backend-handler.ts",
6
6
  "scripts": {
@@ -683,9 +683,13 @@ const handleEvent = async (message: WSMessage) => {
683
683
  if (revisionResult.roles.length > 0) {
684
684
  roleMap.set(revisionResult.serviceId, revisionResult.roles);
685
685
  }
686
+
687
+ let resolvedRevisionService: Service | null = null;
686
688
  if (revisionResult.updatedService) {
687
- const resolved = resolveServiceStatus(revisionResult.updatedService);
688
- servicesMap.set(revisionResult.serviceId, resolved);
689
+ resolvedRevisionService = resolveServiceStatus(
690
+ revisionResult.updatedService,
691
+ );
692
+ servicesMap.set(revisionResult.serviceId, resolvedRevisionService);
689
693
  }
690
694
  if (revisionResult.updatedEnvironment) {
691
695
  const envId = revisionResult.updatedService?.environment;
@@ -701,12 +705,11 @@ const handleEvent = async (message: WSMessage) => {
701
705
  }
702
706
  if (
703
707
  revisionResult.serviceDeploymentErrorEvent &&
708
+ resolvedRevisionService &&
704
709
  String(entityId) ===
705
710
  String(revisionResult.updatedService?.currentRevision)
706
711
  ) {
707
- eventHelper.service.publish.deploymentError(
708
- revisionResult.serviceDeploymentErrorEvent,
709
- );
712
+ eventHelper.service.publish.deploymentError(resolvedRevisionService);
710
713
  }
711
714
  if (
712
715
  revisionResult.shouldFetchChannels &&
@@ -1910,12 +1913,15 @@ export const updateUserComplete = (updatedUserData: UserData): User => {
1910
1913
  }
1911
1914
  };
1912
1915
  const resolveServiceStatus = (service: Service): Service => {
1913
- const revisionKey = `${service.tenant}/${service.name}-${service.currentRevision}`;
1914
- const currentRevision = revisionsMap.get(revisionKey);
1916
+ if (service.status?.code === "REMOVING_SERVICE") {
1917
+ return service;
1918
+ }
1915
1919
 
1916
1920
  if (service.error) {
1917
1921
  return service;
1918
1922
  }
1923
+ const revisionKey = `${service.tenant}/${service.name}-${service.currentRevision}`;
1924
+ const currentRevision = revisionsMap.get(revisionKey);
1919
1925
 
1920
1926
  if (!currentRevision) {
1921
1927
  return service;