Skip to content

Commit 7425d67

Browse files
committed
fix(cloud tasks): ignore duplicate inactive acct email task error by message
Because: - we saw some "entity already exists" errors reported to Sentry when creating Google Cloud Task for the second inactive account notification email This commit: - updates the error detection to use the error message only - I originally used 10 as the error code as that was what I saw in the error during development (and still see at the time of this patch); that value does not match the documented gRPC constant for that type of error. But this wouldn't be the first time I've noticed a discrepancy between the gRPC stuff and nodejs + REST.
1 parent 91bda52 commit 7425d67

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/fxa-auth-server/lib/inactive-accounts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const requestForGlean = {
6363
} as unknown as AuthRequest;
6464

6565
export const isCloudTaskAlreadyExistsError = (error) =>
66-
error.code === 10 && error.message.includes('entity already exists');
66+
error.message.includes('entity already exists');
6767

6868
export type InactiveStatusOAuthDb = Pick<
6969
typeof OAuthDb,

packages/fxa-auth-server/scripts/delete-inactive-accounts/enqueue-inactive-account-deletions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ const init = async () => {
543543
// Note that the fxa cloud tasks lib already emitted some statsd metrics
544544
statsd.increment(
545545
'cloud-tasks.inactive-account-email.enqueue.error-code',
546-
[cloudTaskQueueError.code as unknown as string]
546+
{ errorCode: cloudTaskQueueError.code as unknown as string }
547547
);
548548
await glean.inactiveAccountDeletion.firstEmailTaskRejected(
549549
requestForGlean,

0 commit comments

Comments
 (0)