-
-
Notifications
You must be signed in to change notification settings - Fork 658
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: Added cursor pagination to slackapp conversations query #4442
Conversation
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
} | ||
nextCursor = moreChannels.response_metadata?.next_cursor; | ||
this.logger.debug( | ||
`This page had ${channels.length} channels`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe introducting a metric of number of slack channels found could be helpfull?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We've been struggling with not getting hold of all channels. Reading the documentation I found the support for next_cursor in the response_metadata, as long as the response has a next_cursor, there are responses left, so this PR adds a loop for querying until the next cursor or the channels list is undefined or `''`. This should solve the issue Wayfair had as well.
We've been struggling with not getting hold of all channels. Reading the documentation I found the support for next_cursor in the response_metadata, as long as the response has a next_cursor, there are responses left, so this PR adds a loop for querying until the next cursor or the channels list is undefined or
''
. This should solve the issue Wayfair had as well.