Closed kushthedude closed 4 years ago
Do you know what specifically broke?
I didn't get time to check as we had to make the production release, but I will let you know once I get into it again.
Instead of fetching another page on scrolling to bottom, all the loader items are appended again, and loaded individually from backend.
And the problem starts from Ember Data 3.15
So, for example, /speakers?page[size]=12&page=1 loads first page. Starting from Ember Data 3.15, instead of loading /speakers?page[size]=12&page=2, it makes 12 requests for each speaker, like /speakers/1, /speakers/2, /speakers/3 ... /speakers/12 and then append the previously loaded speakers again this way
Example:
Ember Data 3.16.0 (Broken) https://dist.iamareebjamal.now.sh/e/a74665c3/speakers
Ember Data 3.14.1 (Correct) https://eventyay.com/e/a74665c3/speakers
https://github.com/emberjs/ember.js/releases/tag/v3.17.0
It might be good to check if 3.17
fixes it!
It didn't
I recently tried upgrading to Ember 3.16, and I get error messages with the InfinityModel:
index.js:172 Uncaught Error: Assertion Failed: You attempted to update `perPageParam` on `<InfinityModel:ember1781>`, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
With a stack trace for the offending modification coming from infinity.js#model
:
Ember.setProperties(infinityModel, { ...initParams
});
FWIW our experience with 3.16 breaking everything has finally been resolved:
get
ted other computed properties using the same infinity model, but for some reason those computed properties received stale data so the UI using those computed properties was always a page behind, which meant you had to scroll up and down to trigger infinity-loader again. This seems to be a subtle change in Ember behaviour which I doubt will be reverted... moral of the story is don't use observers, we've used Ember.run.next
as a workaround for now.Can't speak for 3.17 since the glimmer VM update seems to have broken ember-wormhole even more than the 2.10 one did. 🤦♂️
Thank you for letting us know! Closing for now since the backport and your PR seems to have resolved all issues! Thanks again for the PR!!
We recently upgraded our ember-data from 3.14.1 to 3.16.0, but this upgrade broke the infinity loaders at all the places by fetching the same data again & again.
It would be great if the support for 3.16.0 can be extended soon. References : https://github.com/fossasia/open-event-frontend/pull/3950 https://github.com/fossasia/open-event-frontend/issues/3986
cc: @snewcomer