tectonic icon indicating copy to clipboard operation
tectonic copied to clipboard

Data ordering is not retained from REST endpoint data ordering when fetching a LIST

Open aindeev opened this issue 7 years ago • 1 comments

This seems to be a small bug with how the data is stored. If we fetch the following two REST endpoints back to back:

/stops?ids=1&ids=2&ids&=3 returns => [1,2,3] /stops?ids=3&ids=2&ids&=1 returns => [1,2,3] even though the API returns [3,2,1]

aindeev avatar Aug 19 '17 15:08 aindeev

Hmm, thanks for the heads up, sorry that bug's hitting you. Going to take a look at the reducer and see how we're storing this.

Tectonic is meant to store the IDs that the query returns separately from the data such that we can always ensure ordering when injecting props (https://github.com/tonyhb/tectonic/issues/6). There must be an issue with either determining the ID order, saving the ID order, or rebuilding the ID order from the cache and reducer.

Poking around now.

tonyhb avatar Aug 21 '17 22:08 tonyhb