google-cloud-datastore icon indicating copy to clipboard operation
google-cloud-datastore copied to clipboard

Emulator doesn't differentiate between MORE_RESULTS_AFTER_LIMIT and NO_MORE_RESULTS

Open pcostell opened this issue 8 years ago • 4 comments

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 aa loop condition.

pcostell avatar Jul 25 '16 17:07 pcostell

@pcostell is this still an issue? We had another question about this pop up in https://github.com/GoogleCloudPlatform/google-cloud-node/issues/2846

stephenplusplus avatar Jul 13 '18 18:07 stephenplusplus

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.

jskeet avatar Apr 03 '19 10:04 jskeet

@pcostell It seems like this issue persists; can we route this internally to the emulator team?

meredithslota avatar Oct 11 '22 20:10 meredithslota

I created internal issue b/259553638 and have routed it to the Datastore Emulator team. Thanks!

meredithslota avatar Nov 17 '22 17:11 meredithslota