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

bugfix: escape destroyed objects on workers #9719

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pacyL2K19
Copy link
Contributor

This PR

@FelixMalfait please check this workaround

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR modifies event handling to prevent foreign key constraint violations when destroying records by filtering out events without 'after' properties before sending them to audit logs and timeline activities.

  • Fixed foreign key violation in packages/twenty-server/src/engine/api/graphql/workspace-query-runner/listeners/entity-events-to-db.listener.ts by adding event.properties.after check
  • Incorrect type annotations in handleDelete and handleDestroy methods using ObjectRecordUpdateEvent instead of ObjectRecordDeleteEvent
  • Unfiltered events still being sent to webhookQueueService could cause similar issues
  • Root cause of foreign key constraint violation may need deeper investigation rather than event filtering

💡 (5/5) You can turn off certain types of comments like style here!

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

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

Successfully merging this pull request may close these issues.

Destroying record throws an exception in logs
1 participant