fix: old providers without selection

This commit is contained in:
Nevo David 2026-01-05 21:10:12 +07:00
parent 691d15db03
commit 3f674de401
4 changed files with 31 additions and 2 deletions

View File

@ -288,6 +288,7 @@ export class PostActivity {
return refresh;
} catch (err) {
await this._refreshIntegrationService.setBetweenSteps(integration);
return false;
}
}

View File

@ -309,6 +309,16 @@ export class IntegrationRepository {
});
}
async setBetweenRefreshSteps(id: string) {
return this._integration.model.integration.update({
where: {
id,
},
data: {
inBetweenSteps: true,
},
});
}
refreshNeeded(org: string, id: string) {
return this._integration.model.integration.update({
where: {

View File

@ -204,6 +204,10 @@ export class IntegrationService {
return this._integrationRepository.refreshNeeded(org, id);
}
async setBetweenRefreshSteps(id: string) {
return this._integrationRepository.setBetweenRefreshSteps(id);
}
async refreshTokens() {
const integrations = await this._integrationRepository.needsToBeRefreshed();
for (const integration of integrations) {

View File

@ -42,6 +42,14 @@ export class RefreshIntegrationService {
return refresh;
}
public async setBetweenSteps(integration: Integration) {
await this._integrationService.setBetweenRefreshSteps(integration.id);
await this._integrationService.informAboutRefreshError(
integration.organizationId,
integration
);
}
private async refreshProcess(
integration: Integration,
socialProvider: SocialProvider
@ -61,12 +69,18 @@ export class RefreshIntegrationService {
integration
);
await this._integrationService.disconnectChannel(integration.organizationId, integration);
await this._integrationService.disconnectChannel(
integration.organizationId,
integration
);
return false;
}
if (!socialProvider.reConnect) {
if (
!socialProvider.reConnect ||
integration.rootInternalId === integration.internalId
) {
return refresh;
}