Skip to content

Commit c50451d

Browse files
committed
Move createTime to the LAST index key component, but did not fix unit tests
1 parent a4bcfa5 commit c50451d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/firestore/src/local/indexeddb_remote_document_cache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,19 +289,19 @@ class IndexedDbRemoteDocumentCacheImpl implements IndexedDbRemoteDocumentCache {
289289
): PersistencePromise<MutableDocumentMap> {
290290
const collection = query.path;
291291
const startKey: DbRemoteDocumentCollectionIndexKey = [
292-
MIN_CREATE_TIME,
293292
collection.popLast().toArray(),
294293
collection.lastSegment(),
295294
toDbTimestampKey(offset.readTime),
296295
offset.documentKey.path.isEmpty()
297296
? ''
298-
: offset.documentKey.path.lastSegment()
297+
: offset.documentKey.path.lastSegment(),
298+
''
299299
];
300300
const endKey: DbRemoteDocumentCollectionIndexKey = [
301-
MAX_CREATE_TIME,
302301
collection.popLast().toArray(),
303302
collection.lastSegment(),
304303
[Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
304+
'',
305305
''
306306
];
307307

packages/firestore/src/local/indexeddb_sentinels.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ export const DbRemoteDocumentCollectionGroupIndexPath = [
199199
export const DbRemoteDocumentCollectionIndex = 'collectionIndex';
200200

201201
export const DbRemoteDocumentCollectionIndexPath = [
202-
'document.createTime',
203202
'prefixPath',
204203
'collectionGroup',
205204
'readTime',
206-
'documentId'
205+
'documentId',
206+
'document.createTime'
207207
];
208208

209209
export const MIN_CREATE_TIME = '' as const;
@@ -218,11 +218,11 @@ export const MAX_CREATE_TIME = '\uFFFF' as const;
218218
* filtering.
219219
*/
220220
export type DbRemoteDocumentCollectionIndexKey = [
221-
/** document.createTime */ typeof MIN_CREATE_TIME | typeof MAX_CREATE_TIME,
222221
/** path to collection */ string[],
223222
/** collection group */ string,
224223
/** read time */ DbTimestampKey,
225-
/** document ID */ string
224+
/** document ID */ string,
225+
/** document.createTime */ typeof MIN_CREATE_TIME | typeof MAX_CREATE_TIME
226226
];
227227

228228
export const DbRemoteDocumentGlobalStore = 'remoteDocumentGlobal';

0 commit comments

Comments
 (0)