You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think correct behavior is following nextForwardToken until nextForwardToken stops changing in between invocations. Doing this does not seem to be possible with the current AWSPager class so maybe fetching until events is an empty list can work as well, though I'm not certain if that is correct in all cases.
Something like
instance AWSPager GetLogEvents where
page rq rs
| not (isJust (rs ^. glersNextForwardToken)) = Nothing
| not (null (rs ^. glersEvents)) = Nothing
| otherwise = Just $ rq & gleNextToken .~ rs ^. glersNextForwardToken
The text was updated successfully, but these errors were encountered:
That paginator does not generate good code for amazonka: it tries to stop if nextForwardToken is Nothing, but the API will return the token it was given if there's nothing new. It will also stop if events is Nothing, but we are told to expect empty events even if we're not at the end of the paging. It will request another page otherwise, which means that it will try to page forever. This isn't a trivial fix, so it's a post-2.0 problem.
Given that it's not in botocore and I suspect the java pager will likely try to page indefinitely also, I think there's an argument for just closing this issue. But I'll leave it open in case someone want to try refactoring how paginators are parsed/generated.
The GetLogEvents (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogEvents.html) API call can take nextToken as usual, but the response is a bit unusual in that it returns both a nextBackwardToken and nextForwardToken. I think that's what confusing the code generator.
I think correct behavior is following nextForwardToken until nextForwardToken stops changing in between invocations. Doing this does not seem to be possible with the current AWSPager class so maybe fetching until events is an empty list can work as well, though I'm not certain if that is correct in all cases.
Something like
The text was updated successfully, but these errors were encountered: