fix: validate-metadata-required-for-on-all-entities#6658
fix: validate-metadata-required-for-on-all-entities#6658
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
| } | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, [metadataFieldsAssociatedtoEntity]) | ||
| }, [initialFields, metadataFields.length]) |
There was a problem hiding this comment.
Metadata state never refreshes on entity switch
Medium Severity
The initialization effect only copies initialFields when metadataFields.length === 0. After one entity loads, changing entityId keeps previous metadataFields instead of replacing them with new query data, so the form can show and validate stale metadata for the wrong entity.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| return store.dispatch( | ||
| metadataService.endpoints.getEntityMetadataFields.initiate(data, options), | ||
| ) | ||
| } |
There was a problem hiding this comment.
Unused metadata dispatch helper exported
Low Severity
The new exported helper getEntityMetadataFields appears unused across the frontend. Keeping an unused exported dispatch wrapper in useMetadataField.ts adds dead API surface and makes future maintenance harder because behavior changes may needlessly be kept in sync in multiple access patterns.


Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Closes #6520
Includes a refactor of the logic in order to prepare #6620
mergeMetadataFieldsandmetadataValidationin a utils + unit testsHow did you test this code?