diff --git a/libraries/nestjs-libraries/src/integrations/refresh.integration.service.ts b/libraries/nestjs-libraries/src/integrations/refresh.integration.service.ts index 0689bdc603..bf59c32bb1 100644 --- a/libraries/nestjs-libraries/src/integrations/refresh.integration.service.ts +++ b/libraries/nestjs-libraries/src/integrations/refresh.integration.service.ts @@ -78,6 +78,10 @@ export class RefreshIntegrationService { .catch((err) => false); if (!refresh || !refresh.accessToken) { + // informAboutRefreshError (with the failure cause) already notifies + // the user, and refreshNeeded sets the same flag disconnectChannel + // would — calling disconnectChannel here sent a second, cause-less + // copy of the same email for every failed refresh. await this._integrationService.refreshNeeded( integration.organizationId, integration.id @@ -89,11 +93,6 @@ export class RefreshIntegrationService { cause ); - await this._integrationService.disconnectChannel( - integration.organizationId, - integration - ); - return false; }