You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To resolve the issue of duplicated calendar events display, follow these steps:
Modify getTimelineCalendarEventsForPeopleAndWorkspace Method: In /packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts, enhance the logic to check for duplicate events. After retrieving the calendar events and before returning them, implement a deduplication logic based on a unique attribute of the events (e.g., start time, end time, and title).
Implement Deduplication Logic: Use the groupBy function from lodash to group events by their unique identifier. Then, for each group with more than one event, merge them into a single event. This could involve averaging the start and end times or simply picking one event to represent the group.
Adjust CalendarEvent Repository: If the duplication is due to events being fetched separately for each person in a workspace, consider adjusting the queries in /packages/twenty-server/src/modules/calendar/repositories/calendar-event to filter out duplicates at the database level. This might involve using SQL's DISTINCT keyword or a similar mechanism to ensure that each event is unique across all users in a workspace.
These steps should help in merging the display of duplicate events, ensuring that each calendar event is displayed uniquely, regardless of how many users have it in their calendars.
Current Behavior
Duplicate display of certain calendar events occurs, likely due to their presence in both my calendar and a team member's.
Desired Behavior
Merge the display of duplicate events.
The text was updated successfully, but these errors were encountered: