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';
5353import { Value as ProtoValue } from '../protos/firestore_proto_api' ;
5454import { debugAssert } from '../util/assert' ;
5555import { logDebug } from '../util/log' ;
56- import { immediateSuccessor } from '../util/misc' ;
56+ import { immediateSuccessor , primitiveComparator } from '../util/misc' ;
5757import { ObjectMap } from '../util/obj_map' ;
5858import { diffSortedSets , SortedSet } from '../util/sorted_set' ;
5959
@@ -612,9 +612,12 @@ export class IndexedDbIndexManager implements IndexManager {
612612 if ( indexes . length === 0 ) {
613613 return null ;
614614 }
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+ } ) ;
618621 return indexes [ 0 ] . collectionGroup ;
619622 } ) ;
620623 }
You can’t perform that action at this time.
0 commit comments