Skip to content

Conversation

@benthecarman
Copy link
Collaborator

Another thing in the backend but not the cli

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Dec 11, 2025

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

if payments.len() >= target_count as usize || response.next_page_token.is_none() {
next_page_token = response.next_page_token;

if payments.len() >= target_count as usize || next_page_token.is_none() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The point of surfacing the next_page_token back to the user is so that they can continue iterating after we've already satisfied their request to provide at least n payments ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes

@ldk-reviews-bot
Copy link

🔔 1st Reminder

Hey @tankyleo! This PR has been waiting for your review.
Please take a look when you have a chance. If you're unable to review, please let us know so we can find another reviewer.

Comment on lines +31 to +41
impl From<ListPaymentsResponse> for CliListPaymentsResponse {
fn from(response: ListPaymentsResponse) -> Self {
let next_page_token = response.next_page_token.map(format_page_token);

CliListPaymentsResponse { payments: response.payments, next_page_token }
}
}

fn format_page_token(token: PageToken) -> String {
format!("{}:{}", token.token, token.index)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a better fit in the fn handle_list_payments_request in ldk-server ? Pretty much delete the PageToken type in the proto definition, and switch it to optional string next_page_token = 2.

Like this people who interact with the server programmatically also no longer can mishandle these two pieces ?

Although I agree they get a single object of type PageToken, so may be good enough there.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants