You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Queries that start at a cursor report that they start at the very beginning until you go to the first element #204
A query result from a query that starts at a cursor will say getCursorAfter is actually the default cursor (Cursor{bytes=}) rather than the cursor it started with.
This creates complications for testing / resuming a result set that was never iterated.
The old Java 8 datastore SDK didn't have this issue.
Environment details
Specify the API at the beginning of the title. For example, "BigQuery: ...").
General, Core, and Other are also allowed as types
OS type and version: any
Java version: 8/11
datastore version(s): current master (0.87.1)
Steps to reproduce
Start cloud_datastore_emulator on localhost:8081
Run code example
Code example
importcom.google.cloud.datastore.*;
Datastoreds = DatastoreOptions.newBuilder().setProjectId("project").setHost("localhost:8081").build().getService();
ds.put(Entity.newBuilder(Key.newBuilder("project", "Kind", "name-01").build()).build());
ds.put(Entity.newBuilder(Key.newBuilder("project", "Kind", "name-02").build()).build());
ds.put(Entity.newBuilder(Key.newBuilder("project", "Kind", "name-03").build()).build());
QueryResults<Entity> run = ds.run(Query.newEntityQueryBuilder().setKind("Kind").build());
run.next();
Cursorcursor = run.getCursorAfter();
QueryResults<Entity> run2 = ds.run(Query.newEntityQueryBuilder().setKind("Kind").setStartCursor(cursor).build());
// expected:assertrun2.getCursorAfter().equals(cursor);
// actual: run2.getCursorAfter() is the default cursor until run2.next() is called
A query result from a query that starts at a cursor will say getCursorAfter is actually the default cursor (
Cursor{bytes=}) rather than the cursor it started with.This creates complications for testing / resuming a result set that was never iterated.
The old Java 8 datastore SDK didn't have this issue.
Environment details
General, Core, and Other are also allowed as types
Steps to reproduce
Start cloud_datastore_emulator on localhost:8081
Run code example
Code example