Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix default ordering on OnlineModView
The default order on which the packages are shown on OnlineModView is "whatever was received from the API". Old implementation cached the results in a file, where they could be written and read in the same order. When the cache was moved to IndexedDB, the order was inadvertently changed to "whatever the database returns". To stay true to the old implementation, order of each package is stored in each entry in the database, so the result set can be ordered by this field. Dexie/IndexedDB doesn't support both filtering and ordering the results on database level, so the ordering is now on JS instead. The alternative would be to fetch all packages in order and filter packages from other communities on JS. Determining which way is the most efficient is difficult since there seems to be a lot of arbitrary variance in the executions times, at least on the dev build. The performance of the implementation in this commit didn't seem to differ substantially from the unordered implementation, so it was deemed good enough.
- Loading branch information