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

fix(api-headless-cms): skip invalid DZ values instead of throwing #4202

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

Pavel910
Copy link
Collaborator

Changes

This PR ensures that DZ field storage doesn't create a default [] value, because it will break subsequent partial draft saving. To make this possible, we had to reduce the amount of errors being thrown by DZ field transform plugin, and instead use reasonable fallbacks. If the incoming value is not valid for storage, we simply skip it. Doing it this way ensures data consistency in the database/opensearch, and also allows us to save partial entries, where a DZ field can be null or undefined.

How Has This Been Tested?

Manually, and Jest tests.

@Pavel910 Pavel910 added this to the 5.40.2 milestone Jul 12, 2024
@Pavel910 Pavel910 self-assigned this Jul 12, 2024
@Pavel910 Pavel910 merged commit cf2c192 into dev Jul 12, 2024
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.

1 participant