close
Skip to content

Fix paging for events commands - #126

Merged
mattwiller merged 5 commits into
masterfrom
events_paging
Mar 25, 2019
Merged

Fix paging for events commands#126
mattwiller merged 5 commits into
masterfrom
events_paging

Conversation

@mattwiller

Copy link
Copy Markdown
Contributor

Both events commands were not correctly paging through the API results and writing to output. To resolve this completely, a few different things needed to be addressed:

  • box events flags were adjusted to be more strict and ensure that the command always has either a stream position and limit, or a closed date-time range
  • The latest box-node-sdk was pulled in, which contained a fix so the raw events JSON is returned instead of a useless iterator (since Node SDK iterators don't work with the event stream)
  • box events was updated to use the raw JSON to manually page through the events results when a date range is specified (it just gives one page when a stream position is passed in, so the user can manually page if they want)
  • box events:poll required a fix around how the CLI was consuming the events stream, because event emitters don't play nice with async functions

Fixes #122

@nidoran nidoran left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Lgtm!

@mattwiller
mattwiller merged commit c724f08 into master Mar 25, 2019
@mattwiller
mattwiller deleted the events_paging branch March 25, 2019 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

box events missing pagination options and stream_position parameter

2 participants