You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At https://github.com/SitePen/dstore/blob/v1.0.1/Trackable.js#L98, the fetch function created by makeFetch returns a chained promise off of the original QueryResults object, losing any additional information such as totalLength. This will cause consumers that expect proper QueryResults to fail. (For example, this affects dgrid with Pagination and Tree, since it uses fetch for rendering children in that case.)
Meanwhile, fwiw, I suspect those when calls in Trackable's fetch/fetchRange functions can be simplified to use then now that the APIs are always async.
The text was updated successfully, but these errors were encountered:
I am hesitant to backport this to 1.0.x since it slightly modifies the behavior of fetch, such that the array return from fetch (and fetchSync) is no longer updated/maintained by Trackable (it maintains a separate internal array). This is actually more consistent, as it matches the behavior of fetchRange, and I think more closely follows the intent of fetch, in that it returns a snapshot of data. However, this change in behavior seems like it would fit better in a 1.x release.
If there's a clean workaround that you can suggest for people on 1.0.x, that might be good enough for now... otherwise, this issue can sort of throw a wrench in the works if you need to do something with totalLength on a tracked collection.
(Sorry, my initial response was totally thinking this was a different ticket...)
At https://github.com/SitePen/dstore/blob/v1.0.1/Trackable.js#L98, the
fetch
function created bymakeFetch
returns a chained promise off of the originalQueryResults
object, losing any additional information such astotalLength
. This will cause consumers that expect properQueryResults
to fail. (For example, this affects dgrid with Pagination and Tree, since it usesfetch
for rendering children in that case.)I've created a
trackable-fetch-test
branch with failing unit tests.Meanwhile, fwiw, I suspect those
when
calls in Trackable's fetch/fetchRange functions can be simplified to usethen
now that the APIs are always async.The text was updated successfully, but these errors were encountered: