File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/firestore/src/local Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ import { isArray } from '../model/values';
53
53
import { Value as ProtoValue } from '../protos/firestore_proto_api' ;
54
54
import { debugAssert } from '../util/assert' ;
55
55
import { logDebug } from '../util/log' ;
56
- import { immediateSuccessor } from '../util/misc' ;
56
+ import { immediateSuccessor , primitiveComparator } from '../util/misc' ;
57
57
import { ObjectMap } from '../util/obj_map' ;
58
58
import { diffSortedSets , SortedSet } from '../util/sorted_set' ;
59
59
@@ -612,9 +612,12 @@ export class IndexedDbIndexManager implements IndexManager {
612
612
if ( indexes . length === 0 ) {
613
613
return null ;
614
614
}
615
- indexes . sort (
616
- ( l , r ) => l . indexState . sequenceNumber - r . indexState . sequenceNumber
617
- ) ;
615
+ indexes . sort ( ( l , r ) => {
616
+ const cmp = l . indexState . sequenceNumber - r . indexState . sequenceNumber ;
617
+ return cmp !== 0
618
+ ? cmp
619
+ : primitiveComparator ( l . collectionGroup , r . collectionGroup ) ;
620
+ } ) ;
618
621
return indexes [ 0 ] . collectionGroup ;
619
622
} ) ;
620
623
}
You can’t perform that action at this time.
0 commit comments