Skip to content

Crashes on Page 5 with pagination set to 250 using Algolia #2305

@TheJaredWilcurt

Description

@TheJaredWilcurt

Describe the bug

Steps to reproduces:

  1. https://npmx.dev/search?q=PATH
  2. Use Algolia search
  3. Set pagination to 250 per page
  4. Sort by Relevance
  5. Columns: version, description, Downloads/wk, Last Published
  6. Table layout
  7. Click Page 2, then 3, then 4, then 5

Expected:

  • 250 entries are displayed for page 5

Actual:

  • Page freezes, in Firefox browsers it will ask if you want to stop the script after the page is frozen for a few minutes. The main thread is locked, and after 30 minutes of letting the tab idle, it never unlocked. Seems like there is a bug with network call error handling.
  • Network call:
{
  "results": [
    {
      "hits": [],
      "nbHits": 64812,
      "offset": 1000,
      "length": 250,
      "message": "you can only fetch the 1000 hits for this query. You can extend the number of hits returned via the paginationLimitedTo index parameter or use the browse method. You can read our FAQ for more details about browsing: https://www.algolia.com/doc/guides/sending-and-managing-data/manage-your-indices/how-to/export-an-algolia-index/#exporting-the-index-using-an-api-client",
      "exhaustiveNbHits": false,
      "exhaustiveTypo": false,
      "exhaustive": {
        "nbHits": false,
        "typo": false
      },
      "query": "PATH",
      "params": "query=PATH&offset=1000&length=250&analyticsTags=%5B%22npmx.dev%22%5D&attributesToRetrieve=%5B%22name%22%2C%22version%22%2C%22description%22%2C%22modified%22%2C%22homepage%22%2C%22repository%22%2C%22owners%22%2C%22downloadsLast30Days%22%2C%22downloadsRatio%22%2C%22popular%22%2C%22keywords%22%2C%22deprecated%22%2C%22isDeprecated%22%2C%22license%22%5D&attributesToHighlight=%5B%5D&optionalFacetFilters=%5B%22_searchInternal.popularAlternativeNames%3Apath%22%5D",
      "index": "npm-search",
      "processingTimeMS": 71,
      "processingTimingsMS": {
        "_request": {
          "roundTrip": 145
        },
        "afterFetch": {
          "merge": {
            "entries": {
              "decompress": 4,
              "parse": 6,
              "total": 10
            },
            "mergeLoop": {
              "prepareNextHit": 14,
              "total": 14
            },
            "total": 15
          },
          "total": 15
        },
        "fetch": {
          "query": 6,
          "scanning": 45,
          "total": 53
        },
        "getIdx": {
          "load":
          {
            "total": 1
          },
          "total": 1
        },
        "total": 71
      },
      "serverTimeMS": 72
    }
  ]
}

Related UX Complaints:

  • The pagination only shows the next page and last page. If I am on Page 1, I can only go to page 2 or 250. If I am on page 3 I can only go to Page 4 or 250. I can't skip straight to page 5.
  • Refreshing the page (like when it crashes) forgets the page count
  • I can't change the page count in the URL param, something like:
  • The UI settings (table view, relevance, columns, etc) are not in the URL, so it's harder to create a bug report reproducing the page state without just documenting everything. If this was in the URL params, I could just copy/paste the URL to reproduce the bug. Looks like p=npm exists.
  • Clicking on an item and then clicking the back button sets you back on the first page

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions