-
Notifications
You must be signed in to change notification settings - Fork 646
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
Right now, we have to manually set startFromHead: true when calling paginateGetLogEvents, or the pagination ends unexpectedly.
This kind of thing is a really irritating waste of time, it should be improved. paginateGetLogEvents should set whatever default options necessary to ensure sane behavior or throw an error explaining how to call it in a way that actually works
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/client-cloudwatch-logs@3.651.1
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Node 20.10.0
Reproduction Steps
for await (const page of paginateGetLogEvents(
{
client,
stopOnSameToken: true,
},
{
logGroupIdentifier: logGroupName.replace(/:\*$/, ""),
logStreamName,
startTime: startTime.getTime(),
endTime: endTime.getTime(),
},
)) {Observed Behavior
the loop ends after getting one page
Expected Behavior
the loop goes through all pages between startTime and endTime
Possible Solution
If the underlying service can't be improved then paginateGetLogEvents should set a default value of startFromHead: true when none is provided, so that it can behave in a sane manner. If paginating backward from most to least recent with startFromHead: false/no value can't work, then paginateGetLogEvents should just throw an error explaining it that option doesn't work.
Additional Information/Context
No response