-
Notifications
You must be signed in to change notification settings - Fork 122
List ingress pagination #1383
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
base: main
Are you sure you want to change the base?
List ingress pagination #1383
Conversation
|
fe047a0 to
54c5988
Compare
protobufs/livekit_models.proto
Outdated
| string token = 1; | ||
| } | ||
|
|
||
| message CursorPagination { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 -
Line 228 in edf9ff2
| 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..
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
biglittlebigben
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.