@firebase/firestore 3.12.1-canary.e642fc7cd → 3.12.1-canary.fe7da7ec3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import * as grpc from '@grpc/grpc-js';
9
9
  import * as protoLoader from '@grpc/proto-loader';
10
10
 
11
11
  const name = "@firebase/firestore";
12
- const version$1 = "3.12.1-canary.e642fc7cd";
12
+ const version$1 = "3.12.1-canary.fe7da7ec3";
13
13
 
14
14
  /**
15
15
  * @license
@@ -62,7 +62,7 @@ User.GOOGLE_CREDENTIALS = new User('google-credentials-uid');
62
62
  User.FIRST_PARTY = new User('first-party-uid');
63
63
  User.MOCK_USER = new User('mock-user');
64
64
 
65
- const version = "9.22.1-canary.e642fc7cd";
65
+ const version = "9.22.1-canary.fe7da7ec3";
66
66
 
67
67
  /**
68
68
  * @license
@@ -11045,17 +11045,17 @@ class TargetIndexMatcher {
11045
11045
  return false;
11046
11046
  }
11047
11047
  const segments = fieldIndexGetDirectionalSegments(index);
11048
+ let equalitySegments = new Set();
11048
11049
  let segmentIndex = 0;
11049
11050
  let orderBysIndex = 0;
11050
11051
  // Process all equalities first. Equalities can appear out of order.
11051
11052
  for (; segmentIndex < segments.length; ++segmentIndex) {
11052
11053
  // We attempt to greedily match all segments to equality filters. If a
11053
11054
  // filter matches an index segment, we can mark the segment as used.
11054
- // Since it is not possible to use the same field path in both an equality
11055
- // and inequality/oderBy clause, we do not have to consider the possibility
11056
- // that a matching equality segment should instead be used to map to an
11057
- // inequality filter or orderBy clause.
11058
- if (!this.hasMatchingEqualityFilter(segments[segmentIndex])) {
11055
+ if (this.hasMatchingEqualityFilter(segments[segmentIndex])) {
11056
+ equalitySegments = equalitySegments.add(segments[segmentIndex].fieldPath.canonicalString());
11057
+ }
11058
+ else {
11059
11059
  // If we cannot find a matching filter, we need to verify whether the
11060
11060
  // remaining segments map to the target's inequality and its orderBy
11061
11061
  // clauses.
@@ -11068,13 +11068,16 @@ class TargetIndexMatcher {
11068
11068
  if (segmentIndex === segments.length) {
11069
11069
  return true;
11070
11070
  }
11071
- // If there is an inequality filter, the next segment must match both the
11072
- // filter and the first orderBy clause.
11073
11071
  if (this.inequalityFilter !== undefined) {
11074
- const segment = segments[segmentIndex];
11075
- if (!this.matchesFilter(this.inequalityFilter, segment) ||
11076
- !this.matchesOrderBy(this.orderBys[orderBysIndex++], segment)) {
11077
- return false;
11072
+ // If there is an inequality filter and the field was not in one of the
11073
+ // equality filters above, the next segment must match both the filter
11074
+ // and the first orderBy clause.
11075
+ if (!equalitySegments.has(this.inequalityFilter.field.canonicalString())) {
11076
+ const segment = segments[segmentIndex];
11077
+ if (!this.matchesFilter(this.inequalityFilter, segment) ||
11078
+ !this.matchesOrderBy(this.orderBys[orderBysIndex++], segment)) {
11079
+ return false;
11080
+ }
11078
11081
  }
11079
11082
  ++segmentIndex;
11080
11083
  }
@@ -27237,11 +27240,12 @@ function connectFirestoreEmulator(firestore, host, port, options = {}) {
27237
27240
  var _a;
27238
27241
  firestore = cast(firestore, Firestore$1);
27239
27242
  const settings = firestore._getSettings();
27240
- if (settings.host !== DEFAULT_HOST && settings.host !== host) {
27241
- logWarn('Host has been set in both settings() and useEmulator(), emulator host ' +
27242
- 'will be used');
27243
+ const newHostSetting = `${host}:${port}`;
27244
+ if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) {
27245
+ logWarn('Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' +
27246
+ 'will be used.');
27243
27247
  }
27244
- firestore._setSettings(Object.assign(Object.assign({}, settings), { host: `${host}:${port}`, ssl: false }));
27248
+ firestore._setSettings(Object.assign(Object.assign({}, settings), { host: newHostSetting, ssl: false }));
27245
27249
  if (options.mockUserToken) {
27246
27250
  let token;
27247
27251
  let user;