Skip to content

Pagination in query string #1102

Open
Open

Description

@david-crespo

We could do this today. I think the main reason we haven't is that the cursor is really long. But maybe we should just do it and then think about making it shorter on the API side if we really care.

Activity

  1. changed the title [-]Pagination in query[/-] [+]Pagination in query string[/+] on Aug 2, 2022
  2. just-be-dev commented on Aug 3, 2022

    @just-be-dev
    Contributor

    The length likely matters less in the case of query params. It's hard to really do anything about having a shorter cursor given it generally maps to a UUID. Still, it's more likely the case that they'd just copy+paste that. Given the overall length of our URLs anyway, I doubt many folks will be typing stuff out by hand 😅. Need a shortcode service, haha.

  3. david-crespo commented on Oct 24, 2022

    @david-crespo
    CollaboratorAuthor

    The other reason we haven't done this yet is that we can't get to the previous page. So if you have a cursor in the query string and you refresh, you can only go forward, not back. Not very useful.

  4. david-crespo commented on Feb 8, 2023

    @david-crespo
    CollaboratorAuthor

    We need to capture the various bits of API work on pagination in a tracking issue. To me this is pretty bad right now and very important to the basic usage of the console, but we'll need to prioritize that API work if we want to make progress.

  5. modified the milestones: MVP, MVP+1 on Feb 8, 2023
  6. david-crespo commented on Feb 8, 2023

    @david-crespo
    CollaboratorAuthor

    Switched to MVP+1 because I think fixing pagination is very important, but I'm not sure putting it in the query string, as one part of that, is necessary for MVP.

  7. just-be-dev commented on Feb 9, 2023

    @just-be-dev
    Contributor

    An odd note on pagination. Dropshot is designed such that the pagination token contains all the necessary query parameters to look up a given page. In practice this means that selectors in the new api (.e.g. ?organization={org}&project={project}, etc) get encoded into the pagination parameter. So using the API looks something like this:

    GET /v1/instances?organization={org}&project={project} # List page one
    GET /v1/instances?page_token={token} #List page two
    

    Previously when the hierarchy was encoded into the route this wasn't really a big deal. Given that everything is now query parameters it does change how the API is used.

    This doesn't really mean anything for how pagination works in console. It does mean that the pagination token will be longer than we originally anticipated. You aren't going to be typing this in by hand.

  8. david-crespo commented on Feb 9, 2023

    @david-crespo
    CollaboratorAuthor

    You can still leave in the redundant organization={org}&project={project} in the page 2 call, right?

  9. just-be-dev commented on Feb 9, 2023

    @just-be-dev
    Contributor

    I don't think it'll error out, but my understanding is that that's invalid. It will, at best, be ignored.

  10. removed this from the MVP+1 milestone on Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions