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

I've assigned @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

Comment on lines +112 to +117
#[arg(long)]
#[arg(help = "Page token value to continue from a previous page")]
page_token_value: Option<String>,
#[arg(long)]
#[arg(help = "Page token index to continue from a previous page")]
page_token_index: Option<i64>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance we can make these into a single argument to eliminate footguns ? As long as we can display the PageToken as a single object that they can directly copy into the single argument here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that's a good call out. Will need #78 first so we can have custom cli output types for this

Comment on lines +257 to +262
if page_token_value.is_some() != page_token_index.is_some() {
return Err(LdkServerError::new(
InternalError,
"Both --page-token-value and --page-token-index must be provided together".to_string(),
));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Single argument eliminates the possibility of this error here

@benthecarman benthecarman mentioned this pull request Dec 13, 2025
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