ENG-3603: Fix custom field updates on privacy declarations#8024
Merged
dsill-ethyca merged 2 commits intomainfrom Apr 24, 2026
Merged
ENG-3603: Fix custom field updates on privacy declarations#8024dsill-ethyca merged 2 commits intomainfrom
dsill-ethyca merged 2 commits intomainfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
dsill-ethyca
pushed a commit
that referenced
this pull request
Apr 24, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-3603
Description Of Changes
Fixes a bug where updating custom fields on privacy declarations would fail with either a "duplicate key value violates unique constraint" or "null value in column id violates not-null constraint" error.
Root cause:
buildCustomFieldsPayloadinuseSystemDataUseCrud.tswas incorrectly using the custom field definition ID as the custom field record ID in the upsert payload. Since definition IDs are shared across all declarations, the second declaration's custom fields would collide with the first's on the primary key. Additionally, the declaration matching after save only checkeddata_use, notname, which could target the wrong declaration when multiple share the same data use.Companion PR: Requires ethyca/fidesplus PR (linked in ENG-3603) for the backend fix that strips
idfrom the bulk update dict to preventSET id=NULLwhen the frontend omits the field.Code Changes
idfrom the upsert payload inbuildCustomFieldsPayload— the backend finds existing records by(resource_id, custom_field_definition_id)and auto-generates UUIDs for new onespatchDataUsesto use bothdata_useandname, consistent with the backend'sprivacy_declaration_logical_iddeclarationAlreadyExiststo match backend behavior (nulland""treated as equivalent)Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedAdd a db-migration labelAdd a high-risk labelUpdates unreleased work already in Changelog