diff --git a/packages/backend/src/registry.ts b/packages/backend/src/registry.ts index ac437e25..a342b1a0 100644 --- a/packages/backend/src/registry.ts +++ b/packages/backend/src/registry.ts @@ -265,12 +265,15 @@ export class Registry { throw new Error(`No record found for ${lrn}`); } - const hash = await this.generateConfigHash( - data.environmentVariables, - data.requesterAddress, - data.publicKey, - data.apiUrl, - ); + let hash; + if (Object.keys(data.environmentVariables).length !== 0) { + hash = await this.generateConfigHash( + data.environmentVariables, + data.requesterAddress, + data.publicKey, + data.apiUrl, + ); + } // Create record of type ApplicationDeploymentRequest and publish const applicationDeploymentRequest = { @@ -281,9 +284,7 @@ export class Registry { dns: data.dns, // https://git.vdb.to/cerc-io/laconic-registry-cli/commit/129019105dfb93bebcea02fde0ed64d0f8e5983b - config: JSON.stringify({ - ref: hash, - }), + config: JSON.stringify(hash ? { ref: hash } : {}), meta: JSON.stringify({ note: `Added by Snowball @ ${DateTime.utc().toFormat( "EEE LLL dd HH:mm:ss 'UTC' yyyy" diff --git a/packages/backend/src/service.ts b/packages/backend/src/service.ts index 0a09c27e..bdc23ad1 100644 --- a/packages/backend/src/service.ts +++ b/packages/backend/src/service.ts @@ -243,7 +243,7 @@ export class Service { if (oldDNSDeployment) { // Send removal request for the previous DNS deployment and delete DB entry - if (oldDNSDeployment.url === deployment.url) { + if (oldDNSDeployment.url !== deployment.url) { await this.laconicRegistry.createApplicationDeploymentRemovalRequest({ deploymentId: oldDNSDeployment.applicationDeploymentRecordId!, deployerLrn: oldDNSDeployment.deployer.deployerLrn,