Open trunneml opened 2 months ago
I think removing .items()
and returning the full EventIterator in https://github.com/Asana/python-asana/blob/bab9fe81d808ced6788ae5464ae075db8105f184/asana/api/events_api.py#L161 should fix this problem. But this would be a breaking API change.
Hi @trunneml,
See my comment for a workaround here. Thanks for pointing this out. I think it's probably best for us not to try to auto paginate our events endpoint and let users handle how they want to call our events endpoint.
The problem with auto paginating our events endpoint is we have to decide when to stop the iteration. So we could either stop the iteration when the Asana API returns has_more
is false
OR keep calling the next sync token making the get_events
method turn into an event stream where it constantly fetches and watches for new events. If we go with the event stream approach we'll need to add some kind of delay otherwise it'll hit the Asana API rate limits.
What's your use case with our events endpoint? And how would you prefer this endpoint behaves for python?
Your example only shows how to receive events when we already have the sync token. But atleast your example does not provide the new sync token for the next call.
Without the sync token this part of the API is not that helpful.