GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(firestore): add regression test for limit(0) serialization · googleapis/google-cloud-node@d8aecde

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handwritten/firestore/dev
    • src/reference
      • query-util.ts
      • query.ts
    • test
      • query.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handwritten/firestore/dev/src/reference/query-util.ts‎

Copy file name to clipboardExpand all lines: handwritten/firestore/dev/src/reference/query-util.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export class QueryUtil<
344344
// call to `requestStream()` will backoff should the restart
345345
// fail before delivering any results.
346346
let newQuery: Query<AppModelType, DbModelType>;
347-
if (!this._queryOptions.limit) {
347+
if (this._queryOptions.limit === undefined) {
348348
newQuery = query;
349349
} else {
350350
const newLimit =
Collapse file

‎handwritten/firestore/dev/src/reference/query.ts‎

Copy file name to clipboardExpand all lines: handwritten/firestore/dev/src/reference/query.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ export class Query<
16081608
structuredQuery.startAt = this.toCursor(this._queryOptions.startAt);
16091609
structuredQuery.endAt = this.toCursor(this._queryOptions.endAt);
16101610

1611-
if (this._queryOptions.limit) {
1611+
if (this._queryOptions.limit !== undefined) {
16121612
structuredQuery.limit = {value: this._queryOptions.limit};
16131613
}
16141614

Collapse file

‎handwritten/firestore/dev/test/query.ts‎

Copy file name to clipboardExpand all lines: handwritten/firestore/dev/test/query.ts
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,9 +1958,6 @@ describe('limit() interface', () => {
19581958
await query.get();
19591959
});
19601960

1961-
// Regression test: This test currently fails because limit(0) is not
1962-
// serialized in the query proto (limit(0) is falsy in JavaScript).
1963-
// This test is expected to fail until the fix is applied.
19641961
it('handles limit(0) correctly', async () => {
19651962
const overrides: ApiOverride = {
19661963
runQuery: request => {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.