-
Notifications
You must be signed in to change notification settings - Fork 124
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
Fix visibility prompt bug #6800
base: main
Are you sure you want to change the base?
Conversation
Test Results 17 files ±0 17 suites ±0 2h 17m 46s ⏱️ - 3m 40s Results for commit 0b0297c. ± Comparison against base commit 59a42ad. This pull request removes 274 and adds 274 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
51a7b33
to
a81a2ba
Compare
a81a2ba
to
b6ce4dd
Compare
b6ce4dd
to
0b0297c
Compare
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 think it would be good to add tests to ensure that all cases are being covered as expected. Checking size and inclusion of all items from new permissions in old permissions could miss items in old permissions which have been removed. I see that you're casting @saved_permissions into a set so would set comparison work (@saved_permissions.to_set == new_permissions.to_set
) ?
Fixes
Fixes #6537
Summary
When saving a work in Sirenia, users consistently receive a prompt to verify changes to visibility, even when they did not make any edits to visibility. This is due to an underlying bug in comparing saved permissions with new permissions.
Guidance for testing, such as acceptance criteria or new user interface behaviors:
Type of change (for release notes)
notes-bugfix
Bug FixesDetailed Description
the underlying problem is in this method in
app/controllers/concerns/hyrax/works_controller_behavior.rb
:when using Valkyrie, the array comparison between
@saved_permissions
andHyrax::AccessControl.for(resource: curation_concern).permissions
is always returning false even when permissions are exactly the same, because order in the two arrays is not always the same.Changes proposed in this pull request:
@samvera/hyrax-code-reviewers