-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix labelIdentifierFieldMetadata creation for custom objects #8729
Fix labelIdentifierFieldMetadata creation for custom objects #8729
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
This PR adds validation and error handling for label identifier fields in custom objects, ensuring proper creation and association of label identifiers with object metadata.
- Added
INVALID_LABEL_IDENTIFIER
exception code in/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.exception.ts
- Added validation check in
createOne()
to ensure label identifier field exists usingCUSTOM_OBJECT_STANDARD_FIELD_IDS.name
- Added automatic update of
labelIdentifierFieldMetadataId
after object creation in/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts
- Implemented error handling to throw exception when label identifier field creation fails
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
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.
LGTM
if (!labelIdentifierFieldMetadata) { | ||
throw new ObjectMetadataException( | ||
'Label identifier field metadata not created properly', | ||
ObjectMetadataExceptionCode.INVALID_LABEL_IDENTIFIER, |
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.
MISSING_LABEL_IDENTIFIER
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.
MISSING_CUSTOM_OBJECT_DEFAULT_LABEL_IDENTIFIER_FIELD
## Context Following #8729 This command backfills missing labelIdentifier for custom objects
## Context Following #8729 This command backfills missing labelIdentifier for custom objects
No description provided.