-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[24.0] Fix Collection Scrolling not showing all items #17720
Conversation
Good call on the side effect, totally plausible. The unit test failure is legit and 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: And then this stack follows:
|
Update: I was wrong about the cause and fix. See updated PR text |
test failures are relevant |
Looks great, thanks for tracking this down. I tested against several large histories (including that soil one) and it's all working nicely now. |
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 tojobState
.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)
License