Skip to content

Commit b02d4a9

Browse files
committed
remove 'exclusive'
1 parent 3d6d92b commit b02d4a9

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

packages/firestore/src/remote/existence_filter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ import { BloomFilter as ProtoBloomFilter } from '../protos/firestore_proto_api';
1919

2020
export class ExistenceFilter {
2121
// TODO(b/33078163): just use simplest form of existence filter for now
22-
constructor(public count: number, public unchangedNames?: ProtoBloomFilter) {
23-
}
22+
constructor(public count: number, public unchangedNames?: ProtoBloomFilter) {}
2423
}

packages/firestore/src/remote/serializer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { resumeTokenForSnapshot } from '../../test/util/helpers';
1918
import { Bound } from '../core/bound';
2019
import { DatabaseId } from '../core/database_info';
2120
import {

packages/firestore/test/unit/specs/existence_filter_spec.test.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { describeSpec, specTest } from './describe_spec';
2323
import { spec } from './spec_builder';
2424
import { RpcError } from './spec_rpc_error';
2525

26-
describeSpec('Existence Filters:', ['exclusive'], () => {
26+
describeSpec('Existence Filters:', [], () => {
2727
specTest('Existence filter match', [], () => {
2828
const query1 = query('collection');
2929
const doc1 = doc('collection/1', 1000, { v: 1 });
@@ -35,18 +35,20 @@ describeSpec('Existence Filters:', ['exclusive'], () => {
3535
.watchSnapshots(2000);
3636
});
3737

38-
// TODO:(mila) update the tests when bloom filter is
39-
specTest('Existence filter with bloom filter match', ['exclusive'], () => {
38+
// This test is only to make sure watchFilters can accept bloom filter.
39+
// TODO:(mila) update the tests when bloom filter logic is implemented.
40+
specTest('Existence filter with bloom filter match', [], () => {
4041
const query1 = query('collection');
4142
const doc1 = doc('collection/1', 1000, { v: 1 });
4243
return spec()
4344
.userListens(query1)
4445
.watchAcksFull(query1, 1000, doc1)
4546
.expectEvents(query1, { added: [doc1] })
46-
.watchFilters([query1], [doc1.key],{bits:{bitmap:"a",padding:1}, hashCount:1})
47-
.watchSnapshots(2000)
48-
.watchFilters([query1])
49-
.watchSnapshots(3000);
47+
.watchFilters([query1], [doc1.key], {
48+
bits: { bitmap: 'a', padding: 1 },
49+
hashCount: 1
50+
})
51+
.watchSnapshots(2000);
5052
});
5153

5254
specTest('Existence filter match after pending update', [], () => {
@@ -126,8 +128,9 @@ describeSpec('Existence Filters:', ['exclusive'], () => {
126128
);
127129
});
128130

129-
// todo
130-
specTest('Existence filter mismatch triggers bloom filter', ['exclusive'], () => {
131+
// This test is only to make sure watchFilters can accept bloom filter.
132+
// TODO:(mila) update the tests when bloom filter logic is implemented.
133+
specTest('Existence filter mismatch triggers bloom filter', [], () => {
131134
const query1 = query('collection');
132135
const doc1 = doc('collection/1', 1000, { v: 1 });
133136
const doc2 = doc('collection/2', 1000, { v: 2 });
@@ -136,7 +139,10 @@ describeSpec('Existence Filters:', ['exclusive'], () => {
136139
.userListens(query1)
137140
.watchAcksFull(query1, 1000, doc1, doc2)
138141
.expectEvents(query1, { added: [doc1, doc2] })
139-
.watchFilters([query1], [doc1.key],{bits:{bitmap:"a",padding:1},hashCount:3}) // in the next sync doc2 was deleted
142+
.watchFilters([query1], [doc1.key], {
143+
bits: { bitmap: 'a', padding: 1 },
144+
hashCount: 3
145+
}) // in the next sync doc2 was deleted
140146
.watchSnapshots(2000)
141147
// query is now marked as "inconsistent" because of filter mismatch
142148
.expectEvents(query1, { fromCache: true })

packages/firestore/test/unit/specs/spec_builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { DocumentKey } from '../../../src/model/document_key';
3333
import { FieldIndex } from '../../../src/model/field_index';
3434
import { JsonObject } from '../../../src/model/object_value';
3535
import { ResourcePath } from '../../../src/model/path';
36-
import { BloomFilter as ProtoBloomFilter} from '../../../src/protos/firestore_proto_api';
36+
import { BloomFilter as ProtoBloomFilter } from '../../../src/protos/firestore_proto_api';
3737
import {
3838
isPermanentWriteError,
3939
mapCodeFromRpcCode,

packages/firestore/test/util/spec_test_helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function encodeWatchChange(
4646
filter: {
4747
targetId: watchChange.targetId,
4848
count: watchChange.existenceFilter.count,
49-
unchangedNames:watchChange.existenceFilter.unchangedNames
49+
unchangedNames: watchChange.existenceFilter.unchangedNames
5050
}
5151
};
5252
}

0 commit comments

Comments
 (0)