Skip to content
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

Fix default ordering on OnlineModView #1303

Merged
merged 1 commit into from
Apr 24, 2024
Merged

Commits on Apr 19, 2024

  1. 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.
    anttimaki committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    5c87aa4 View commit details
    Browse the repository at this point in the history