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

fix(logadmin): use consistent filter in paging example #8221

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

noahdietz
Copy link
Contributor

Without supplying a timestamp in the ListLogEntries.Filter, the client by default sets one for the last twenty-four hours when the EntryIterator is created. Since this example creates a new EntryIterator on each request, a new timestamp of a slightly different twenty-four hour window is added. When the Next Page button is pressed, it reuses the NextPageToken from the previous call, but that was created for a different twenty-four hour window Filter. This creates a mismatch between the requested Filter and the Filter used to create the NextPageToken, resulting in an error.

To address this, we create the filter in the main function before server start up. In this filter, we set a timestamp explicitly.

Note: I made this a fix commit because this is part of the GoDoc examples and we need this to appear as the latest release, otherwise no one will see it until another release comes along.

Fixes #8186.

@noahdietz noahdietz requested review from a team as code owners July 6, 2023 16:55
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Jul 6, 2023
Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

Thanks

@noahdietz noahdietz added the automerge Merge the pull request once unit tests and other checks pass. label Jul 6, 2023
@gcf-merge-on-green gcf-merge-on-green bot merged commit 9570159 into googleapis:main Jul 6, 2023
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jul 6, 2023
noahdietz added a commit to noahdietz/google-cloud-go that referenced this pull request Jul 6, 2023
gcf-merge-on-green bot pushed a commit that referenced this pull request Jul 6, 2023
gcf-merge-on-green bot pushed a commit that referenced this pull request Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logadmin: Unable to paginate entries throught different processes/requests
2 participants