Skip to content
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

Why does funnel return a next_page_token of "" when finished? #1138

Open
claymcleod opened this issue Jan 29, 2025 · 1 comment
Open

Why does funnel return a next_page_token of "" when finished? #1138

claymcleod opened this issue Jan 29, 2025 · 1 comment
Assignees
Labels
Milestone

Comments

@claymcleod
Copy link

claymcleod commented Jan 29, 2025

From the latest stable version of spec, it seems clear that the intention is to omit the next_page_token key when there are no more pages to read (as indicated by the fact that it is an optional key and there is no guidance in the specification that a value of "" should be interpreted as termination of the pagination). Thus, tes, for example, uses the presence or absence of this field to determine when to stop iterating (https://github.com/stjude-rust-labs/tes/blob/main/src/v1/client.rs#L219-L231). This causes issues when using tes with funnel, as it loops infinitely while trying to list all tasks.

@lbeckman314
Copy link
Member

lbeckman314 commented Jan 30, 2025

Ah thank you for reporting this! Funnel should indeed omit the next_page_token key when on the "last page".

We will make the changes and update here!

Notes for Team: ✍

The "" response is set in tes.pb.go:

func (x *ListTasksRequest) GetPageToken() string {
	if x != nil {
		return x.PageToken
	}
	return ""    <---- Possible to simply return nil here?
}

And called in client.go:

addString(v, "page_token", req.GetPageToken())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants