-
Notifications
You must be signed in to change notification settings - Fork 3.6k
12690-error-unknown-error-importing-calendar-events-reafcto-required #12711
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
12690-error-unknown-error-importing-calendar-events-reafcto-required #12711
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
Refactored calendar event import logic to fix foreign key constraint violations during calendar event synchronization, ensuring events exist before creating associations.
- Introduced new
existingCalendarEventsMapper
utility incalendar-event-mapper.util.ts
to replace the removedinject-ids-in-calendar-events.util.ts
- Restructured
calendar-save-events.service.ts
to handle event creation before associations - Added TSDoc comments in
calendar-channel-event-association.workspace-entity.ts
explainingeventExternalId
uniqueness - Improved error handling for cases where calendar events are not found during import
4 files reviewed, 3 comments
Edit PR Review Bot Settings | Greptile
...erver/src/modules/calendar/calendar-event-import-manager/utils/calendar-event-mapper.util.ts
Outdated
Show resolved
Hide resolved
.../src/modules/calendar/calendar-event-import-manager/services/calendar-save-events.service.ts
Outdated
Show resolved
Hide resolved
.../src/modules/calendar/calendar-event-import-manager/services/calendar-save-events.service.ts
Outdated
Show resolved
Hide resolved
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:60050 This environment will automatically shut down when the PR is closed or after 5 hours. |
}; | ||
}); | ||
|
||
const participantsToSave = filteredEventsWithParticipantsCalendarEventId |
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'm confused by this logic. How updating or saving participants is tied to the fact that the event is already present in DB or not. I would expect us to compare existing participants with new ones?
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.
It is related to the construction of the submethod that are responsible to handle the participants.
I did not investigate, but I guess it is a simple insert for new events, while there is a comparison to do for the updated ones.
Could be refacto as well
…12711) Why : we had an issue impoting events du to CalendarEvents not yet existing while inserting the CalendarChannelAssociation due to inverted method in the service This PR refactors the calendar event import logic by - renaming - splitting utility functions for better clarity and maintainability. - adding TSDoc comments to explain the purpose and uniqueness of the `eventExternalId` field in calendar event associations Fixes #12690 --------- Co-authored-by: Charles Bochet <[email protected]>
…wentyhq#12711) Why : we had an issue impoting events du to CalendarEvents not yet existing while inserting the CalendarChannelAssociation due to inverted method in the service This PR refactors the calendar event import logic by - renaming - splitting utility functions for better clarity and maintainability. - adding TSDoc comments to explain the purpose and uniqueness of the `eventExternalId` field in calendar event associations Fixes twentyhq#12690 --------- Co-authored-by: Charles Bochet <[email protected]>
…12711) Why : we had an issue impoting events du to CalendarEvents not yet existing while inserting the CalendarChannelAssociation due to inverted method in the service This PR refactors the calendar event import logic by - renaming - splitting utility functions for better clarity and maintainability. - adding TSDoc comments to explain the purpose and uniqueness of the `eventExternalId` field in calendar event associations Fixes #12690 --------- Co-authored-by: Charles Bochet <[email protected]>
Why : we had an issue impoting events du to CalendarEvents not yet existing while inserting the CalendarChannelAssociation due to inverted method in the service
This PR refactors the calendar event import logic by
eventExternalId
field in calendar event associationsFixes #12690