Skip to content

Commit d2a8bd0

Browse files
committed
resolve comments
1 parent fc0db95 commit d2a8bd0

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

packages/firestore/src/api/aggregate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export {
2626
AggregateSpec,
2727
AggregateSpecData,
2828
AggregateQuerySnapshot,
29-
aggregateSnapshotEqual
29+
aggregateQuerySnapshotEqual
3030
} from '../lite-api/aggregate';
3131

3232
/**

packages/firestore/src/core/firestore_client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import {
2525
} from '../api/credentials';
2626
import { User } from '../auth/user';
2727
import {
28-
getCount as getCountFromServer,
29-
AggregateQuerySnapshot as LiteAggregateQuerySnapshot
28+
getCount,
29+
AggregateQuerySnapshot
3030
} from '../lite-api/aggregate';
3131
import { Query as LiteQuery } from '../lite-api/reference';
3232
import { LocalStore } from '../local/local_store';
@@ -511,9 +511,9 @@ export function firestoreClientTransaction<T>(
511511
export function firestoreClientRunCountQuery(
512512
client: FirestoreClient,
513513
query: LiteQuery<unknown>
514-
): Promise<LiteAggregateQuerySnapshot<{ count: AggregateField<number> }>> {
514+
): Promise<AggregateQuerySnapshot<{ count: AggregateField<number> }>> {
515515
const deferred = new Deferred<
516-
LiteAggregateQuerySnapshot<{ count: AggregateField<number> }>
516+
AggregateQuerySnapshot<{ count: AggregateField<number> }>
517517
>();
518518
client.asyncQueue.enqueueAndForget(async () => {
519519
const remoteStore = await getRemoteStore(client);
@@ -526,7 +526,7 @@ export function firestoreClientRunCountQuery(
526526
);
527527
} else {
528528
try {
529-
const result = await getCountFromServer(query);
529+
const result = await getCount(query);
530530
deferred.resolve(result);
531531
} catch (e) {
532532
deferred.reject(e as Error);

packages/firestore/src/lite-api/aggregate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function getCount(
143143
*
144144
* @returns true if the AggregateQuerySnapshos are equal.
145145
*/
146-
export function aggregateSnapshotEqual<T extends AggregateSpec>(
146+
export function aggregateQuerySnapshotEqual<T extends AggregateSpec>(
147147
left: AggregateQuerySnapshot<T>,
148148
right: AggregateQuerySnapshot<T>
149149
): boolean {

packages/firestore/test/lite/integration.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { initializeApp } from '@firebase/app';
2020
import { expect, use } from 'chai';
2121
import chaiAsPromised from 'chai-as-promised';
2222

23-
import { aggregateSnapshotEqual, getCount } from '../../src/lite-api/aggregate';
23+
import { aggregateQuerySnapshotEqual, getCount } from '../../src/lite-api/aggregate';
2424
import { Bytes } from '../../src/lite-api/bytes';
2525
import {
2626
Firestore,
@@ -2240,8 +2240,8 @@ describe('countQuery()', () => {
22402240
const snapshot1A = await getCount(query1);
22412241
const snapshot1B = await getCount(query1);
22422242
const snapshot2 = await getCount(query2);
2243-
expect(aggregateSnapshotEqual(snapshot1A, snapshot1B)).to.be.true;
2244-
expect(aggregateSnapshotEqual(snapshot1A, snapshot2)).to.be.true;
2243+
expect(aggregateQuerySnapshotEqual(snapshot1A, snapshot1B)).to.be.true;
2244+
expect(aggregateQuerySnapshotEqual(snapshot1A, snapshot2)).to.be.true;
22452245
});
22462246
});
22472247

@@ -2257,7 +2257,7 @@ describe('countQuery()', () => {
22572257
const query2 = query(coll, where('author', '==', 'authorB'));
22582258
const snapshot1 = await getCount(query1);
22592259
const snapshot2 = await getCount(query2);
2260-
expect(aggregateSnapshotEqual(snapshot1, snapshot2)).to.be.false;
2260+
expect(aggregateQuerySnapshotEqual(snapshot1, snapshot2)).to.be.false;
22612261
});
22622262
});
22632263

0 commit comments

Comments
 (0)