Skip to content

Commit

Permalink
Skip reporting Confluence data if oauth token error (#4574)
Browse files Browse the repository at this point in the history
* Skip reporting Confluence data if oauth token error

* ✨

* ✨
  • Loading branch information
flvndvd authored Apr 4, 2024
1 parent bc694dc commit e3e4bad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connectors/src/connectors/confluence/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,9 @@ export async function confluenceGetReportPersonalActionActivity(
const { connectorId, userAccountId } = params;

const connector = await fetchConfluenceConnector(connectorId);
if (connector.isAuthTokenRevoked) {
return false;
}

// We look for the oldest updated data.
const oldestPageSync = await ConfluencePage.findOne({
Expand Down
4 changes: 4 additions & 0 deletions connectors/src/resources/connector_resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,8 @@ export class ConnectorResource extends BaseResource<ConnectorModel> {
async markAsPaused() {
return this.update({ pausedAt: new Date() });
}

get isAuthTokenRevoked() {
return this.errorType === "oauth_token_revoked";
}
}

0 comments on commit e3e4bad

Please sign in to comment.