-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6382 create a command to add a uservar in the key value pair table for every account which needs to reconnect #6553
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request implements a new command to manage accounts requiring reconnection due to insufficient permissions as part of the upgrade to version 0.23.
- Added
SetUserVarsAccountsToReconnectCommand
in/packages/twenty-server/src/database/commands/upgrade-version/0-23/0-23-set-user-vars-accounts-to-reconnect.command.ts
to handle account reconnection across workspaces - Updated
AccountsToReconnectService
in/packages/twenty-server/src/modules/connected-account/services/accounts-to-reconnect.service.ts
with new methodaddAccountToReconnectByKey
for centralized management - Modified
CalendarChannelSyncStatusService
andMessagingChannelSyncStatusService
to useAccountsToReconnectService
instead of direct user variable manipulation - Updated related modules to include
ConnectedAccountModule
and removeUserVarsModule
, reflecting the shift in account management approach
9 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings
} catch (error) { | ||
this.logger.error( | ||
`Failed to add account to reconnect for workspace ${workspaceId}: ${error.message}`, | ||
); | ||
throw error; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider wrapping the entire loop body in a try-catch to continue processing other accounts if one fails
@@ -52,6 +56,7 @@ import { ViewModule } from 'src/modules/view/view.module'; | |||
SetWorkspaceActivationStatusCommand, | |||
UpdateActivitiesCommand, | |||
BackfillNewOnboardingUserVarsCommand, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: UpgradeTo0_23Command is duplicated in providers array
packages/twenty-server/src/modules/connected-account/services/accounts-to-reconnect.service.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments @bosiraphael
Closes #6382
Create SetUserVarsAccountsToReconnectCommand.
This command loops on all workspaces and:
ACCOUNTS_TO_RECONNECT
USER_VAR
with a key ofACCOUNTS_TO_RECONNECT_INSUFFICIENT_PERMISSIONS
for all connect accounts with a message channel or calendar channel with statusFAILED_INSUFFICIENT_PERMISSIONS