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 Collection Scrolling not showing all items #17720

Merged

Conversation

ElectronicBlueberry
Copy link
Member

@ElectronicBlueberry ElectronicBlueberry commented Mar 14, 2024

fixes #17677

I'm still not entirely sure why this happened. I suspect it happened due to the computed side-effect firing off multiple overlapping requests which could resolve out of order and break the store by splicing the wrong items out of the array.

This PR removes the side effect and denounces the requests. It also removes the splicing, instead using the mergeArray utility, to avoid accidentally removing items.

I cannot reproduce the issue anymore with this patch applied.

Figured out what caused this:

The store contained a loadCollectionElements function, which loads the first 50 elements of a collection and replaces all collection elements with the response, which is triggered on any deep changes to jobState.

I did not find out what caused the change to jobState, as there shouldn't be any, but regardless this function should not replace all collection contents with the first 50 elements of a collection.

I removed the function and replaced it with a new function which marks all collection elements as requiring a reload.

This PR still removes the side-effects and debounces the requests, which I originally thought to be causing this.

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.

@dannon
Copy link
Member

dannon commented Mar 14, 2024

Good call on the side effect, totally plausible. The unit test failure is legit and collectionElementsStore test module needs to be updated.

I also love the idea of denouncing requests. "Bad request!" ;)

I tried this against the same janky history from main (gdscn soil) and I see this, though, when looking at the collection:

image

And then this stack follows:

can't access property Symbol.iterator, payload is undefined
mergeArray@webpack://@galaxyproject/galaxy-client/./src/store/historyStore/model/utilities.js?:14:24
fetchMissingElements/<@webpack://@galaxyproject/galaxy-client/./src/stores/collectionElementsStore.ts?:92:96
fulfilled@webpack://@galaxyproject/galaxy-client/./src/stores/collectionElementsStore.ts?:14:58
promise callback*step@webpack://@galaxyproject/galaxy-client/./src/stores/collectionElementsStore.ts?:16:91
__awaiter</<@webpack://@galaxyproject/galaxy-client/./src/stores/collectionElementsStore.ts?:17:13

@ElectronicBlueberry
Copy link
Member Author

Update: I was wrong about the cause and fix. See updated PR text

@ElectronicBlueberry
Copy link
Member Author

test failures are relevant

@dannon
Copy link
Member

dannon commented Mar 15, 2024

Looks great, thanks for tracking this down. I tested against several large histories (including that soil one) and it's all working nicely now.

@dannon dannon merged commit cea038c into galaxyproject:release_24.0 Mar 15, 2024
27 checks passed
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.

2 participants