Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@agagancarczyk
Copy link
Contributor

Closes #22570

@agagancarczyk agagancarczyk requested a review from a team as a code owner August 24, 2023 14:39
@ghost ghost added the team/ui label Aug 24, 2023
@cypress
Copy link

cypress bot commented Aug 24, 2023

2 flaky tests on run #8640 ↗︎

0 527 48 0 Flakiness 2

Details:

Merge 6b6a113 into de44892...
Project: Keycloak Admin UI Commit: f025d446e1 ℹ️
Status: Passed Duration: 16:56 💡
Started: Aug 24, 2023 2:47 PM Ended: Aug 24, 2023 3:04 PM
Flakiness  realm_settings_client_profiles_test.spec.ts • 1 flaky test • chrome

View Output Video

Test Artifacts
Realm settings client profiles tab tests > Should not create duplicate client profile Output Screenshots
Flakiness  realm_settings_general_tab_test.spec.ts • 1 flaky test • chrome

View Output Video

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.

Copy link
Contributor

@jonkoops jonkoops left a 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;
Copy link
Contributor

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.

Copy link
Contributor Author

@agagancarczyk agagancarczyk Aug 24, 2023

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!

Copy link
Contributor

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!

@agagancarczyk agagancarczyk requested a review from edewit August 24, 2023 18:30
@edewit edewit merged commit 35c3b40 into keycloak:main Aug 25, 2023
agagancarczyk added a commit to agagancarczyk/keycloak that referenced this pull request Aug 28, 2023
Co-authored-by: Agnieszka Gancarczyk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to remove user attributes

3 participants