diff --git a/apps/passport-server/src/services/generic-issuance/pipelines/LemonadePipeline.ts b/apps/passport-server/src/services/generic-issuance/pipelines/LemonadePipeline.ts index 0e54f356be..415122277a 100644 --- a/apps/passport-server/src/services/generic-issuance/pipelines/LemonadePipeline.ts +++ b/apps/passport-server/src/services/generic-issuance/pipelines/LemonadePipeline.ts @@ -834,7 +834,9 @@ export class LemonadePipeline implements BasePipeline { const ticketActions: PCDAction[] = []; - if (this.loaded) { + // If the Atom DB is not empty, i.e. if we have loaded atoms for this pipeline + // at least once since the server started, delete the folder. + if ((await this.db.load(this.id)).length > 0) { ticketActions.push({ type: PCDActionType.DeleteFolder, folder: this.definition.options.feedOptions.feedFolder, diff --git a/apps/passport-server/src/services/generic-issuance/pipelines/PretixPipeline.ts b/apps/passport-server/src/services/generic-issuance/pipelines/PretixPipeline.ts index d2857fe344..8b4f325106 100644 --- a/apps/passport-server/src/services/generic-issuance/pipelines/PretixPipeline.ts +++ b/apps/passport-server/src/services/generic-issuance/pipelines/PretixPipeline.ts @@ -991,7 +991,9 @@ export class PretixPipeline implements BasePipeline { const actions: PCDAction[] = []; - if (this.loaded) { + // If the Atom DB is not empty, i.e. if we have loaded atoms for this pipeline + // at least once since the server started, delete the folder. + if ((await this.db.load(this.id)).length > 0) { actions.push({ type: PCDActionType.DeleteFolder, folder: this.definition.options.feedOptions.feedFolder,