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] Fix Multi-History status bar reactivity #17812

Merged

Conversation

davelopez
Copy link
Contributor

@davelopez davelopez commented Mar 22, 2024

Fixes reactivity issues related to the HistoryCounter, DefaultOperations, and the History store.

Adds stronger typing to history-related components, especially the HistoryStore, to clarify which information is being stored and retrieved when dealing with histories. This includes a new schema model HistoryDevDetailed used by the "client controller API" and adds more missing fields. Although our FastAPI endpoints do not use this model, it contains the information we are working with when requesting history details in the UI and it's slightly different from the HistoryDetailed model.

TODO

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.

@davelopez
Copy link
Contributor Author

After some investigation, properly implementing status updates in the multi-history requires bigger changes and, at this point, it is starting to feel more like a feature request than a bug.

We need to watch (poll) every history in the multiview to track the changes and I think we don't have an equivalent endpoint to current_history_json for arbitrary histories. We need to add an optional history_id parameter or migrate this endpoint to a proper API with this extra option.

As a bug fix, I think we should probably disable any operation (except for the multi-selection) to any other history that is not current.

What do you think?

@ahmedhamidawan
Copy link
Member

As a bug fix, I think we should probably disable any operation (except for the multi-selection) to any other history that is not current.

We would still be able to move items from/to histories in this view, right? You mean we would just disable the content item operations such as deleting etc?

@davelopez
Copy link
Contributor Author

davelopez commented Mar 25, 2024

We would still be able to move items from/to histories in this view, right? You mean we would just disable the content item operations such as deleting etc?

Exactly, that is my proposition. It should work for moving items from/to histories because we reload the history unconditionally after the operation.

I'm still trying to fix issues with reactivity though, the contents_active updates correctly now the first time, but it isn't on subsequent updates.

@davelopez davelopez force-pushed the 24.0_fix_multi_history_counts branch from 58c4bb9 to cd25d16 Compare March 25, 2024 14:53
@jdavcs jdavcs modified the milestones: 24.0, 24.1 Mar 25, 2024
@jdavcs
Copy link
Member

jdavcs commented Mar 25, 2024

remilestoned to 24.1 (otherwise it's blocking 24.0)

@davelopez
Copy link
Contributor Author

Yes, I'm still struggling with this one... it may take some time to get fixed

@davelopez
Copy link
Contributor Author

The only missing part of the puzzle now is how to make the HistoryCounter reactive... I've been trying to debug on my own and with @itisAliRH for quite some time and we can't see an explanation why is not working... I'm definitely missing something pretty obvious 🤔

image

I would appreciate someone having a look and seeing what might be missing or wrong with it.

The current history details will be loaded by the history watcher anyway.
Technically this model is used by the "client API" in the old controllers so the current API is not using it, but it is useful to have the schema in the client to know what we are getting when requesting something from the server.
This will make the history data available for all the app and reduce duplicated requests.
This should give us an idea of what information is
being stored and retrieved each time.
And avoid reactivity issues with lost references
Add composables to deal with "extended" versions of histories when needed.
Use proper types for history references in components.
To use AnyHistory type and userOwnsHistory function
This allows to request only those fields that might have changed after an operation in the history contents.
I don't like this at all, but we don't have a way to deal with those operations in a multi-view scenario. This should be a temporary fix util we work on enabling real multi-history support both in backend and client.
@davelopez davelopez force-pushed the 24.0_fix_multi_history_counts branch from 592731a to 6b46650 Compare March 27, 2024 09:16
Let's do this on dev, after we evaluate what to improve.
davelopez and others added 2 commits March 27, 2024 13:45
To accurately reflect what the server is serializing for each different view or usual request from the client.
@davelopez davelopez marked this pull request as ready for review March 27, 2024 13:11
@davelopez
Copy link
Contributor Author

It's working now as expected! 🎉
Thank you @dannon so much for figuring out the reactivity issue!!

Multi-HistOperationOnDatasetsIssue-FIX

Copy link
Member

@dannon dannon left a comment

Choose a reason for hiding this comment

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

Thanks @davelopez!

@mvdbeek mvdbeek merged commit 75a809e into galaxyproject:release_24.0 Mar 28, 2024
28 checks passed
@davelopez davelopez deleted the 24.0_fix_multi_history_counts branch March 28, 2024 09:58
const { wrapper, axiosMock } = await setUpWrapper(UserHistoriesMock, count, currentHistoryId);
const wrapper = await setUpWrapper(count, currentHistoryId);

console.log(wrapper.html());
Copy link
Member

Choose a reason for hiding this comment

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

Debug leftover?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

absolutely... 😅 Thanks!

🦅 👁️ 😄

@jdavcs jdavcs modified the milestones: 24.1, 24.0 Apr 2, 2024
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.

6 participants