Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagination sets next query even though there are no more results #5

Closed
rakyll opened this issue Jun 11, 2014 · 7 comments
Closed

pagination sets next query even though there are no more results #5

rakyll opened this issue Jun 11, 2014 · 7 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. 🚨 This issue needs some love. status: blocked Resolving the issue is dependent on other work. triage me I really want to be triaged.

Comments

@rakyll
Copy link
Contributor

rakyll commented Jun 11, 2014

If the query contains a limit, backend keeps returning MORE_RESULTS_AFTER_LIMIT even though there are none.

var q = ds.query(['Kind']).limit(10);

We make an end cursor comparison to detect where to terminate pagination, but it costs us one extra query that returns an empty list of results.

@rakyll
Copy link
Contributor Author

rakyll commented Jun 17, 2014

b/10688926

@rakyll rakyll changed the title Pagination sets next query even though there are no more results datastore: pagination sets next query even though there are no more results Jul 11, 2014
@rakyll rakyll added the blocked label Jul 11, 2014
@stephenplusplus
Copy link
Contributor

Any updates on this one? Just going through old issues :)

@rakyll
Copy link
Contributor Author

rakyll commented Aug 29, 2014

This will never be fixed probably in the short term (I mean in 2-3 years).

@silvolu
Copy link
Contributor

silvolu commented Aug 29, 2014

We could workaround this by making 2 calls the first time, one for the current page and one for the next page. If there are no results in the next page, we return null for next query. If there is another page, we store the results and return nextquery. For following queries, we would request page+1 to determine if there are still results, store the new page in memory if that's the case, return the previously stored page and return nextquery according to whether we have or not a next page.
Does it make sense?

@rakyll
Copy link
Contributor Author

rakyll commented Aug 29, 2014

We've talked about implementing this offline, but I wonder what happens if what we cache is dirty. User will not have a way to invalidate it. It could be unexpected in many cases. I think that's why we haven't implemented it the way you've described above in the first place.

@ryanseys
Copy link
Contributor

costs us one extra query that returns an empty list of results.

Sounds like a small price to pay to provide a better experience to developers

@stephenplusplus stephenplusplus added the api: datastore Issues related to the Datastore API. label Jan 20, 2015
@stephenplusplus stephenplusplus changed the title datastore: pagination sets next query even though there are no more results pagination sets next query even though there are no more results Jan 20, 2015
@stephenplusplus
Copy link
Contributor

Our default pagination behavior has changed dramatically since this issue (almost exactly 1 year ago!). By default, we now run query after query until no results are returned. This behavior can be switched off to revert to manual pagination. But, this specific issue no longer applies to our library, and whatever is going on in "b/10688926", that's where the misleading backend behavior issue can be tracked.

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
chingor13 pushed a commit that referenced this issue Aug 26, 2022
VERSION is used in @google-cloud/cloud-rad to publish ref docs for
a particular version. Pass VERSION in via Stubby or Fusion.
Source-Link: googleapis/synthtool@740366b
Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:bbdd52de226c00df3356cdf25460397b429ab49552becca645adbc412f6a4ed5
sofisl pushed a commit that referenced this issue Sep 15, 2022
sofisl pushed a commit that referenced this issue Sep 16, 2022
Update dependencies to enable Greenkeeper 🌴
sofisl pushed a commit that referenced this issue Sep 27, 2022
sofisl pushed a commit that referenced this issue Oct 5, 2022
Update dependencies to enable Greenkeeper 🌴
sofisl pushed a commit that referenced this issue Oct 8, 2022
Update dependencies to enable Greenkeeper 🌴
sofisl pushed a commit that referenced this issue Oct 12, 2022
* chore(package): update dependencies
sofisl pushed a commit that referenced this issue Nov 11, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
sofisl added a commit that referenced this issue Nov 11, 2022
sofisl added a commit that referenced this issue Nov 12, 2022
* feat: add tests and samples to library

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Nov 12, 2022
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: Benjamin Coe <bencoe@google.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl added a commit that referenced this issue Nov 16, 2022
Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Jan 10, 2023
sofisl pushed a commit that referenced this issue Jan 24, 2023
sofisl pushed a commit that referenced this issue Jan 25, 2023
sofisl pushed a commit that referenced this issue Sep 13, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [jsdoc-fresh](https://togithub.com/googleapis/jsdoc-fresh) | [`^1.0.2` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-fresh/1.1.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/compatibility-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/confidence-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/jsdoc-fresh</summary>

### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-fresh/blob/HEAD/CHANGELOG.md#&#8203;200-httpsgithubcomgoogleapisjsdoc-freshcomparev111v200-2022-05-18)

[Compare Source](https://togithub.com/googleapis/jsdoc-fresh/compare/v1.1.1...v2.0.0)

##### ⚠ BREAKING CHANGES

-   update library to use Node 12 ([#&#8203;108](https://togithub.com/googleapis/jsdoc-fresh/issues/108))

##### Build System

-   update library to use Node 12 ([#&#8203;108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ([e61c223](https://togithub.com/googleapis/jsdoc-fresh/commit/e61c2238db8900e339e5fe7fb8aea09642290182))

##### [1.1.1](https://www.github.com/googleapis/jsdoc-fresh/compare/v1.1.0...v1.1.1) (2021-08-11)

##### Bug Fixes

-   **build:** migrate to using main branch ([#&#8203;83](https://www.togithub.com/googleapis/jsdoc-fresh/issues/83)) ([9474adb](https://www.github.com/googleapis/jsdoc-fresh/commit/9474adbf0d559d319ff207397ba2be6b557999ac))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-apigee-registry).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xMTcuMSIsInVwZGF0ZWRJblZlciI6IjMyLjExNy4xIn0=-->
sofisl pushed a commit that referenced this issue Sep 13, 2023
* doc: generate README.md from nodejs-repo-tools

* doc: make quickstart.js a todo

* style: make it TBD first so lint passes
sofisl pushed a commit that referenced this issue Sep 14, 2023
sofisl pushed a commit that referenced this issue Sep 26, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [jsdoc-fresh](https://togithub.com/googleapis/jsdoc-fresh) | [`^1.0.2` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-fresh/1.1.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/compatibility-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/confidence-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/jsdoc-fresh</summary>

### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-fresh/blob/HEAD/CHANGELOG.md#&#8203;200-httpsgithubcomgoogleapisjsdoc-freshcomparev111v200-2022-05-18)

[Compare Source](https://togithub.com/googleapis/jsdoc-fresh/compare/v1.1.1...v2.0.0)

##### ⚠ BREAKING CHANGES

-   update library to use Node 12 ([#&#8203;108](https://togithub.com/googleapis/jsdoc-fresh/issues/108))

##### Build System

-   update library to use Node 12 ([#&#8203;108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ([e61c223](https://togithub.com/googleapis/jsdoc-fresh/commit/e61c2238db8900e339e5fe7fb8aea09642290182))

##### [1.1.1](https://www.github.com/googleapis/jsdoc-fresh/compare/v1.1.0...v1.1.1) (2021-08-11)

##### Bug Fixes

-   **build:** migrate to using main branch ([#&#8203;83](https://www.togithub.com/googleapis/jsdoc-fresh/issues/83)) ([9474adb](https://www.github.com/googleapis/jsdoc-fresh/commit/9474adbf0d559d319ff207397ba2be6b557999ac))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-bigquery-migration).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. 🚨 This issue needs some love. status: blocked Resolving the issue is dependent on other work. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants