-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed removing attributes from a user #22693
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks for verifying this!
Co-authored-by: Agnieszka Gancarczyk <[email protected]>
Closes #22570