Fixed removing attributes from a user#22693
Conversation
2 flaky tests on run #8640 ↗︎Details:
|
|||||||||||||||||||||||||||
| Test | Artifacts | |
|---|---|---|
| Realm settings client profiles tab tests > Should not create duplicate client profile |
Output
Screenshots
|
|
realm_settings_general_tab_test.spec.ts • 1 flaky test • chrome
| Test | Artifacts | |
|---|---|---|
| Realm settings general tab tests > Test all general tab switches |
Output
Screenshots
|
|
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.
jonkoops
left a comment
There was a problem hiding this comment.
LGTM, but let's make sure to test this thoroughly.
| const attributes = | ||
| "key" in (formUser.attributes?.[0] || []) | ||
| ? keyValueToArray(formUser.attributes as KeyValueType[]) | ||
| : user.attributes; |
There was a problem hiding this comment.
I feel like this has been added with some intent to fix a bug, but I could be wrong. Just to be sure, have you tried the following:
- Add a couple of attributes to a user and save.
- Reload the page and change some other field, leaving the attributes, then save the user.
- Reload the page again and save the attributes.
I feel like perhaps if the attributes are left untouched their value in the form might be left empty, hence the fallback to the initial value of the user attributes.
There was a problem hiding this comment.
Thanks @jonkoops I hear what you are saying. I had a similar impression after seeing @edewit commit from 2 weeks ago fixing some bug on the same line of code.
I have now double-checked my fix and it's working as expected for all the scenarios you have outlined above. It's now behaving the way it should.
@edewit can I get your review as well (just in case we are missing something)? Thanks!
There was a problem hiding this comment.
Perfect, thanks for verifying this!
Co-authored-by: Agnieszka Gancarczyk <[email protected]>
Closes #22570