-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add initial state to suggestions #4347
Conversation
If we are very lucky, perhaps this will fix #4288 too 🤞 |
Passing run #4879 ↗︎
Details:
Review all test suite changes for PR #4347 ↗︎ |
Investigating CI failures which appear to be on |
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.
Thanks for digging into this. It's very weird that that specific field is causing this issue. I'm surprised that this hasn't come up yet already.
The fix itself makes sense though!
}).as("updateParty"); | ||
cy.intercept("POST", `/api/v1/plus/custom-metadata/custom-field/bulk`, { | ||
body: {}, | ||
}).as("bulkUpdateCustomField"); |
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.
this is a test that needed to be updated after the changes in ba7f66b
]); | ||
} | ||
); | ||
cy.wait("@bulkUpdateCustomField").then((interception) => { |
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.
also a result of the new bulk update endpoint (which is a lot nicer than what we used to have!)
Closes https://ethyca.atlassian.net/browse/PROD-1255
Description Of Changes
This was a very strange bug, and I think it was introduced by #4294 (comment) but even that seems to be a bit of a red herring...
First I found that if I reverted that particular change described in that comment, things worked. I did a diff between
systemBody
andresult.data
, then added all the fields until I found the one that was causing things to break which was mysteriouslythird_country_transfers
. There's no rhyme or reason to this as far as I can tell, so I dug further...Then I realized the only fields that were being reset were the dictionary fields, so I looked specifically at
useDictSuggestion
.It seems like this line https://github.com/ethyca/fides/blob/aking/prod-1255/fix-system-info-saving/clients/admin-ui/src/features/system/dictionary-form/DictSuggestionInputs.tsx/#L88-L92 was causing problems. The
initialValues
were properly set, but that bit of code would reset all those fields to empty strings sovalues
would be incorrect. Again, this only happens whenthird_country_transfers
is included, which is very strange, and I suspect is not entirely the root cause and may be a red herring (or a sign of something else).By adding a new suggestion state
initial
we can get around this—that line will only fire when we actually want "presuggestions" which I think works pretty well.Screen.Recording.2023-10-26.at.12.27.21.PM.mov
Code Changes
initial
state to suggestionsSteps to Confirm
Pre-Merge Checklist
CHANGELOG.md