Skip to content
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

Double creation of contacts when updating calendar event participants #6254

Closed
bosiraphael opened this issue Jul 15, 2024 · 1 comment · Fixed by #6269
Closed

Double creation of contacts when updating calendar event participants #6254

bosiraphael opened this issue Jul 15, 2024 · 1 comment · Fixed by #6269
Assignees

Comments

@bosiraphael
Copy link
Contributor

Bug Description

The calendar module refactoring introduced a bug when calendar events are updated which causes contacts to be created twice, or events to not be assigned correctly to a participant.

Expected behavior

The calendar event participants should be updated correctly.

@bosiraphael bosiraphael self-assigned this Jul 15, 2024
Copy link
Contributor

greptile-apps bot commented Jul 15, 2024

To resolve the issue of double creation of contacts when updating calendar event participants, follow these steps:

  1. Review updateCalendarEventParticipantsAfterPeopleCreation Method:

    • File: /packages/twenty-server/src/modules/calendar/services/calendar-event-participant/calendar-event-participant.service.ts
    • Ensure that this method does not trigger duplicate contact creation.
  2. Check createCompaniesAndContactsAndUpdateParticipants Method:

    • File: /packages/twenty-server/src/modules/connected-account/auto-companies-and-contacts-creation/services/create-company-and-contact.service.ts
    • Verify that this method is not called multiple times for the same event update.
  3. Inspect handleUpdatedEvent Method:

    • File: /packages/twenty-server/src/modules/calendar/listeners/calendar-channel.listener.ts
    • Ensure that the job to create a company and contact is not added multiple times when isContactAutoCreationEnabled is true.
  4. Examine handleCalendarEventParticipantMatchedEvent Method:

    • File: /packages/twenty-server/src/modules/calendar/listeners/calendar-event-participant.listener.ts
    • Confirm that timeline activities are not inserted multiple times for the same participant.
  5. Add Logging:

    • Add logging in the above methods to trace and ensure that each participant update and contact creation is only processed once.

References

/packages/twenty-server/src/modules/calendar/services/calendar-event-participant/calendar-event-participant.service.ts
/packages/twenty-server/src/modules/calendar/repositories/calendar-event-participant.repository.ts
/packages/twenty-server/src/modules/calendar/services/google-calendar-sync/google-calendar-sync.service.ts
/packages/twenty-server/src/modules/connected-account/auto-companies-and-contacts-creation/services/create-company-and-contact.service.ts
/packages/twenty-server/src/modules/calendar/listeners/calendar-channel.listener.ts
/packages/twenty-server/src/modules/calendar/listeners/calendar-event-participant.listener.ts

About Greptile

This response provides a starting point for your research, not a precise solution.

Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

Ask Greptile · Edit Issue Bot Settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant