fix(logadmin): use consistent filter in paging example#8221
Merged
gcf-merge-on-green[bot] merged 2 commits intogoogleapis:mainfrom Jul 6, 2023
Merged
fix(logadmin): use consistent filter in paging example#8221gcf-merge-on-green[bot] merged 2 commits intogoogleapis:mainfrom
gcf-merge-on-green[bot] merged 2 commits intogoogleapis:mainfrom
Conversation
noahdietz
added a commit
to noahdietz/google-cloud-go
that referenced
this pull request
Jul 6, 2023
Originally merged in googleapis#8221
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Jul 6, 2023
Originally merged in #8221
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Jul 10, 2023
🤖 I have created a release *beep* *boop* --- ## [0.110.5](https://togithub.com/googleapis/google-cloud-go/compare/v0.110.4...v0.110.5) (2023-07-07) ### Bug Fixes * **logadmin:** Use consistent filter in paging example ([#8221](https://togithub.com/googleapis/google-cloud-go/issues/8221)) ([9570159](https://togithub.com/googleapis/google-cloud-go/commit/95701597b1d709543ea22a4b6ff9b28b14a2d4fc)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without supplying a
timestampin theListLogEntries.Filter, the client by default sets one for the last twenty-four hours when theEntryIteratoris created. Since this example creates a newEntryIteratoron each request, a newtimestampof a slightly different twenty-four hour window is added. When theNext Pagebutton is pressed, it reuses theNextPageTokenfrom the previous call, but that was created for a different twenty-four hour windowFilter. This creates a mismatch between the requestedFilterand theFilterused to create theNextPageToken, 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
fixcommit 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.