New request
#19676: Email & Calendar tabs error on custom objects with join-table relations to Person
We'll provision a sandbox, run an agent against the issue, and open a draft PR. You can pull the branch and iterate from there.
Bug
Custom objects that reach Person through a join table render the Email and Calendar tabs in the record detail view, but clicking either shows "An error occurred". Built-in objects like Company work because they have a direct people relation to Person.
Reproduction
- Settings → Data Model → create a custom object
peopleList(Folk-style ad-hoc list of people) - Create a custom join object
peopleListMembershipwith twoMANY_TO_ONErelation fields:peopleList→peopleListperson→person
- Open any
peopleListrecord - Click the Email or Calendar tab in the right-side panel
Expected
Either:
- the tab walks join-table relations transitively to find Person records and shows the union of their messages/events; or
- the tab is hidden when the relation path can't be resolved.
Actual
Tab renders a loading state, then displays "An error occurred". The global messageThreads and calendarEvents GraphQL queries work fine — this is purely a UI relation-traversal limitation when the path to Person is mediated by a join object.
Environment
- Twenty
v1.21.x(self-hosted, Docker) - Workspace has both built-in objects (
person,company,opportunity) and the two custom objects above
Workaround
Tell users those tabs are dead on custom objects with join-table relations — use Notes / Tasks / Files / Members instead.
Suggested fix
Either generalise the relation walker so multi-hop paths through join tables also resolve, or auto-hide Email/Calendar tabs when no direct people relation exists on the object.
Email and Calendar tabs crash on custom objects because the UI relation walker cannot traverse join-table paths to Person.
- packages/twenty-front/src/modules/object-record/hooks
- packages/twenty-front/src/modules/object-metadata/utils
- packages/twenty-front/src/modules/views/components
- packages/twenty-server/src/engine/metadata-modules/flat-field-metadata/utils