-
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
o365 calendar sync #8044
o365 calendar sync #8044
Conversation
Related to #7228 |
Wow @brendanlaschke is back 😍 |
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.
Great job @brendanlaschke ! Thank you very much for your contribution. I've left a couple of comments.
I can add an account but my calendar is stuck in the CALENDAR_EVENT_LIST_FETCH_ONGOING
syncStage
.
Also, we should put this feature behind a feature flag for now. I can assist you with it if you have any questions.
...twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts
Show resolved
Hide resolved
...-import-manager/drivers/microsoft-calendar/services/microsoft-calendar-get-events.service.ts
Outdated
Show resolved
Hide resolved
/award 3500 massive contribution thanks! |
Awarding brendanlaschke: 3500 points 🕹️ Well done! Check out your new contribution on oss.gg/brendanlaschke |
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.
Great job @brendanlaschke ! Amazing contribution. I left some comments to address before we can merge the PR :)
...r/src/modules/calendar/calendar-event-import-manager/calendar-event-import-manager.module.ts
Outdated
Show resolved
Hide resolved
...r/src/modules/calendar/calendar-event-import-manager/calendar-event-import-manager.module.ts
Outdated
Show resolved
Hide resolved
...r/src/modules/calendar/calendar-event-import-manager/calendar-event-import-manager.module.ts
Outdated
Show resolved
Hide resolved
...src/modules/calendar/calendar-event-import-manager/services/calendar-fetch-events.service.ts
Outdated
Show resolved
Hide resolved
...src/modules/calendar/calendar-event-import-manager/services/calendar-fetch-events.service.ts
Outdated
Show resolved
Hide resolved
...src/modules/calendar/calendar-event-import-manager/services/calendar-fetch-events.service.ts
Outdated
Show resolved
Hide resolved
...odules/calendar/calendar-event-import-manager/crons/commands/calendar-import.cron.command.ts
Outdated
Show resolved
Hide resolved
|
||
const response: PageCollection = await microsoftClient | ||
.api(syncCursor || '/me/calendar/events/delta') | ||
.version('beta') |
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.
Why use the beta api and not the v1?
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.
v1 hasn't got the delta queries for events sadly - should still be fine as they are only used to retrieve ids (where the behavior shouldn't change)?
const response: PageCollection = await microsoftClient | ||
.api(syncCursor || '/me/calendar/events/delta') | ||
.version('beta') | ||
.get(); |
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.
I got the following error using a free exchange account. I wasn't aware of this, but to use the microsoft graph api you have to have a valid exchange online subscription.
code = 'NOT_FOUND'
message = 'The mailbox is either inactive, soft-deleted, or is hosted on-premise.'
When this error happens, maybe we should put the channel in FAILED_INSUFFICIENT_PERMISSIONS
for now. Later we might also want to add a User Var as it is done inside accounts-to-reconnect.service
. We store some information inside a key value pair table about the users and the workspace, and we use that to display a banner to alert the user that his account needs to be reconnected. We can do the same here by adding a key UNSUPPORTED_MICROSOFT_ACCOUNTS
and store inside an array the list of these accounts. This will allow us to display a banner to alert the user that he needs an a valid exchange online license to continue.
packages/twenty-server/src/engine/core-modules/auth/services/microsoft-apis.service.ts
Outdated
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.
LGTM :)
Implemented:
I think I would split the messaging part into a second pr - that's a step more complex then the calendar :)