open-rmf / open-rmf/rmf-web

[api-server]: support keyset based pagination

Open
#911 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
137
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Before proceeding, is there an existing issue or discussion for this?
Description

We are currently using offset based pagination, which has some drawbacks

  1. It gets slower as the offset increases.
  2. Result will be inconsistent if rows are added or removed. This mainly affects use cases like exporting data to csv.
Implementation Considerations

Keyset based pagination solves the above problems but has some other drawbacks as well

  1. Pages must be retrieved in order, it is not possible to jump to the middle of the result set.
  2. Typically it is not possible to show the number of results.

These 2 drawbacks means that we need to redesign the frontend, either some kind of infinite scrolling or infinite paging.

We can also do a mixture where the the offset pagination has a hard limit on how deep it can go, more than that will require using keyset pagination.

Alternatives

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing offset-based pagination in the api-server and the frontend consumers that depend on it. Compare the proposed keyset approach with the hard-limit alternative, then define the required frontend pagination behavior; done means the API and frontend support a consistent, ordered pagination flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.