keenlabs / keen-sdk-net

A .NET SDK for the Keen IO API
MIT License
37 stars 23 forks source link

Datasets ListAllDefinitions corner cases #132

Open masojus opened 6 years ago

masojus commented 6 years ago

From review comments:

I just wonder what happens if the first request can give us a Count that can change by the time we 
request a later page...say I request 10 defs, the Count is 15, so we request another 10 or 5 or whatever, 
 but since then another couple datasets have been added. We could potentially stop if we get 20 since 
it's >15, even if there are now actually 30 datasets because a bunch got added.

Likewise, if we request 10, the Count is 15, and before we request another page, some datasets get 
deleted, then we request another 10, but since 5 have been deleted, we get 0 back...according to the 
check above we'll throw even though this is technically correct.

I'll probably open a bug to handle these two cases since they'll require some deeper testing and 
knowing how the back end will actually behave, plus they are somewhat corner cases, so aren't on the 
critical path to getting this functionality usable. Grabbing the the most recent result set's Count instead 
of the first will help, but we'll have to keep a running tab of what's left and potentially tolerate an empty 
result set.
masojus commented 6 years ago

We should also enforce the limit of 100 definitions in a page.