From f1262bf64a591087befa1d1e41dce58cea2a4255 Mon Sep 17 00:00:00 2001 From: Jonathan Barrow Date: Tue, 12 May 2026 11:44:14 -0400 Subject: [PATCH] fix: add automatic this.save() calls to pnid.scrub/markForDeletion --- src/models/pnid.ts | 4 ++++ src/services/grpc/account/v2/delete-account.ts | 2 -- src/services/grpc/api/v2/delete-account.ts | 1 - src/services/nnas/routes/people.ts | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/models/pnid.ts b/src/models/pnid.ts index e12a802..142de96 100644 --- a/src/models/pnid.ts +++ b/src/models/pnid.ts @@ -264,6 +264,8 @@ PNIDSchema.method('markForDeletion', async function markForDeletion() { LOG_ERROR(`ERROR UPDATING SUBSCRIPTION FOR USER ${this.username} (${subscriptionID}). ${error}`); } } + + await this.save(); }); PNIDSchema.method('scrub', async function scrub() { @@ -362,6 +364,8 @@ PNIDSchema.method('scrub', async function scrub() { this.connections.stripe.tier_level = 0; this.connections.stripe.tier_name = ''; this.connections.stripe.latest_webhook_timestamp = 0; + + await this.save(); }); PNIDSchema.method('hasPermission', function hasPermission(flag: PNIDPermissionFlag): boolean { diff --git a/src/services/grpc/account/v2/delete-account.ts b/src/services/grpc/account/v2/delete-account.ts index c4fa924..e4c80cc 100644 --- a/src/services/grpc/account/v2/delete-account.ts +++ b/src/services/grpc/account/v2/delete-account.ts @@ -24,8 +24,6 @@ export async function deleteAccount(request: DeleteAccountRequest): Promise