google-cloud-datastore
google-cloud-datastore copied to clipboard
Emulator doesn't differentiate between MORE_RESULTS_AFTER_LIMIT and NO_MORE_RESULTS
This is a result of the emulator being built
on the Cloud Datastore API for App Engine, which only distinguishes between
NOT_FINISHED or not. Since the more_results
flag is a hint (see below),
the only safe response when the query is finished is
MORE_RESULTS_AFTER_LIMIT.
Something to note:
more_results
is a best effort hint to the developer. In the case of the
emulator it is buggy that MORE_RESULTS_AFTER_LIMIT
is returned even if
the query didn't reach the limit. However even in production, the query may
return MORE_RESULTS_AFTER_LIMIT
even if there are no more results if the
server is unwilling to do the work to check for the next entity.
This is not the issue here but for posterity: in order to determine if you
should keep iterating through results the clients should only ever use
more_results == NOT_FINISHED a
a loop condition.
@pcostell is this still an issue? We had another question about this pop up in https://github.com/GoogleCloudPlatform/google-cloud-node/issues/2846
I've just found this issue by running my .NET integration tests against the emulator. So yes, it looks like it's still an issue.
@pcostell It seems like this issue persists; can we route this internally to the emulator team?
I created internal issue b/259553638 and have routed it to the Datastore Emulator team. Thanks!