⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@milos-lk
Copy link
Contributor

@milos-lk milos-lk commented Jan 23, 2026

Adding CursorPagination - to allow for cursor based list APIs where ordering key could be set to an arbitrary column value (e.g created_at) and tie breaker column (unique) specified to allow for stable result sets.
Adding utilities to encode/decode the token.

@changeset-bot
Copy link

changeset-bot bot commented Jan 23, 2026

⚠️ No Changeset found

Latest commit: d92992b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@milos-lk milos-lk force-pushed the list-ingress-pagination branch from fe047a0 to 54c5988 Compare January 26, 2026 11:56
@milos-lk milos-lk requested a review from paulwe January 26, 2026 14:59
@milos-lk milos-lk marked this pull request as ready for review January 26, 2026 23:15
string token = 1;
}

message CursorPagination {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

essentially same to TokenPagination wrt state it holds - but wanted to add it as a separate type to have clean separation on methods for encoding/decoding

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering we already have an anonymous "TokenPagination" type we can decode to anything we want depending on context, do we really need to expose this mew type at the API level?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

existing token pagination isn't fully anonymous -

func EncodeTokenPagination(offset, limit int32) (*TokenPagination, error) {

my intention with having a separate type was to prevent the misuse of the api, but maybe we don't need to go that far - still not sure - maybe we could use that TokenPagination and have the new set of encoder/decoder APIs with it..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe reusing the TokenPagination + new codecs is actually neater - I think I will update it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's best: overloading the protocol with 3 pagination schemes or requiring implementers (ie LiveKit engineers) to select the right decoding format. Curious to see what other folks think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should standardize on this encoding... sip implements this pattern incorrectly

Copy link
Contributor

@biglittlebigben biglittlebigben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants