firebase / firebase/firebase-tools

Emulator in datastore mode doesn't return "endCursor" while Datastore emulator returns for the same query

Open
#7,352 6 comments 0 reactions 1 assignee Claimed by @harshyyy21 View on GitHub
emulators: firestore Needs: Attention type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools: 7.16.1**

**Platform: macOS**

### [REQUIRED] Test case

```
import requests

emulator_url = 'http://127.0.0.1:50579/v1/projects/test-app:runQuery'

payload = b'{"partitionId": {"projectId": "test-app", "namespaceId": ""}, "query": {"kind": [{"name": "Profile"}], "limit": 1}, "readOptions": {"readConsistency": "EVENTUAL"}}'

headers = {'Content-Length': '169', 'Content-Type': 'application/json'}

# POST request to the emulator
resp = requests.post(emulator_url, headers=headers, data=payload)

# check response's data
data = resp.json()
print(data)
# prints {'batch': {'entityResultType': 'FULL', 'moreResults': 'MORE_RESULTS_AFTER_LIMIT', 'readTime': '2024-06-21T20:20:20.928406Z'}} no "endCursor" within the data.
```

### [REQUIRED] Steps to reproduce

Explained above

### [REQUIRED] Expected behavior

You will see something like
{'entityResultType': 'FULL', 'moreResults': 'MORE_RESULTS_AFTER_LIMIT', 'readTime': '2024-06-20T21:40:28.228019Z'}

### [REQUIRED] Actual behavior
Datastore emulator returns
{'endCursor': 'CgA=', 'entityResultType': 'FULL', 'moreResults': 'MORE_RESULTS_AFTER_LIMIT'} which is close to the production env

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.