Skip to content
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

[24.0] do not expand datasets that are known to be inaccessible #17818

Merged
merged 14 commits into from
May 25, 2024

Conversation

martenson
Copy link
Member

@martenson martenson commented Mar 23, 2024

This now works better for hdas.

It does not fix existing bug for the corner case scenario of dataset collection that have some inaccessible element in it. This is due DCAs not having the accessible property and it is unclear to me whether including it would 1) make sense 2) impose a high performance penalty.

I was experimenting with making the inaccessible items unselectable, but there are actual operations like hide or delete that apply to these hdas (and are pretty likely to be invoked) even though you do not have access to its contents. Therefore I left it untouched. Note other operations will fail ungracefully - like collection building or tags.

also closes #16903


update: I've started reimplementing the inaccessible dataset state.

Screenshot 2024-03-27 at 5 33 13 PM

Notes:

  • This is still broken for inaccessible datasets within collections
  • Disable dragging of inaccessible items
  • Investigate how this affects multiselect and our fancy keyboard selection

This is to show one approach how to address this -- I'd like to discuss this wider before going further.

I am not sure how much we should rely on the accessible property here, but if we do it makes it easier to catch, however we could possibly run into caching problems.
We could also alter the dataset store so the API call is not directly tied to a computed property (this may be an unwanted vue pattern?) which I hope would prevent the loop, and then catch the 403 and give user the latest information.

I have noticed similar issue also happens to data collections that contain some datasets inaccessible to current user. However in that case the collection is not supposed to expand, but open a different view, and that fails to load completely. So you do not even see the datasets you have access to.

edit: I forgot about it but @davelopez reminded me that ideally the history items would already render as inaccessible (white with padlock).


eventually closes #17757

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

I assume the union_mode does not trickle down...

type accessible as literal False
that does not fetch dataset details or allow other interactions

minor adjustments
@martenson martenson marked this pull request as ready for review March 29, 2024 18:33
@github-actions github-actions bot added this to the 24.1 milestone Mar 29, 2024
@jdavcs jdavcs removed this from the 24.1 milestone May 14, 2024
Copy link
Contributor

@davelopez davelopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
Sorry, I forgot this was still pending!

@davelopez
Copy link
Contributor

davelopez commented May 23, 2024

Alright, I was too eager to get this in and overlooked your updated comments in the PR description 😅

This is still broken for inaccessible datasets within collections

I think I have a potential fix for this. Should I push some commits to this branch to test it out?

@jdavcs jdavcs added this to the 24.1 milestone May 23, 2024
@davelopez davelopez marked this pull request as draft May 24, 2024 08:37
@davelopez
Copy link
Contributor

Alright, I pushed a couple of commits to fix the remaining outstanding issue with inaccessible elements in collections.

Basically, I just serialized the accessible attribute for HDAObjects and make sure we don't even try to request details for inaccessible HDAs in the client. I don't know why this accessible field was never serialized before (maybe for performance reasons?) but it looks to me like it is the right thing to do because the UI state will be incorrect otherwise 🤔

Before the changes

CollectionInaccessibleBug

After the changes

CollectionInaccessibleBugFixed

Also, I patched the openapi_to_schema.mjs script to handle boolean constants.

@davelopez davelopez marked this pull request as ready for review May 24, 2024 09:11
@davelopez davelopez marked this pull request as draft May 24, 2024 10:32
@davelopez
Copy link
Contributor

Investigating test failures... of course, It couldn't be so easy... 😆

It is probably enough to serialize the `accessible` property only when requesting collection contents displayed in the UI.
@davelopez davelopez marked this pull request as ready for review May 24, 2024 12:12
@davelopez
Copy link
Contributor

All green now, It wasn't that bad after all 😅

@martenson
Copy link
Member Author

lgtm, the only issue I still see is that the animation for expanding/collapsing looks clunky for the grey items. I assume that is because it is bound to use the same-length animation, but has less height, so everything looks sluggish. Not a big deal at all, I'd just ignore it for now.

thanks for pushing it over the finish line @davelopez !

@mvdbeek mvdbeek merged commit d8b827f into galaxyproject:release_24.0 May 25, 2024
52 checks passed
@galaxyproject-sentryintegration

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ AttributeError: 'NoneType' object has no attribute 'dataset' /api/dataset_collections/{hdca_id}/contents/{pa... View Issue

Did you find this useful? React with a 👍 or 👎

@bgruening bgruening deleted the noexpand-private branch May 27, 2024 21:35
mvdbeek added a commit to mvdbeek/galaxy that referenced this pull request May 28, 2024
Fixes
galaxyproject#17818 (comment):
```
AttributeError
'NoneType' object has no attribute 'dataset'
```
mvdbeek added a commit that referenced this pull request May 28, 2024
Fixes
#17818 (comment):
```
AttributeError
'NoneType' object has no attribute 'dataset'
```
@davelopez
Copy link
Contributor

Nice catch Sentry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants