@@ -1347,8 +1347,9 @@ class IndexedDbIndex extends DbIndexFTSFromRangeQueries {
13471347 highRangeExclusive ?: boolean ,
13481348 reverseOrSortOrder ?: boolean | QuerySortOrder ,
13491349 limit ?: number ,
1350- offset ?: number
1351- ) : Promise < ItemType [ ] > {
1350+ offset ?: number ,
1351+ forceDisableGetAllRecords = false
1352+ ) : Promise < ItemType [ ] & { isFromNewGetAllReverseMethod ?: boolean } > {
13521353 const keyRange = attempt ( ( ) => {
13531354 return this . _getKeyRangeForRange (
13541355 keyLowRange ,
@@ -1373,7 +1374,10 @@ class IndexedDbIndex extends DbIndexFTSFromRangeQueries {
13731374 return IndexedDbProvider . WrapRequest ( this . _store . getAll ( keyRange , limit ) ) ;
13741375 }
13751376
1376- const shouldUseGetAllRecords = this . idbConfigs ?. useGetAllRecordsForGetRange ;
1377+ // use getAllRecords if it is allowed by config during init, and caller does not want to disable it
1378+ const shouldUseGetAllRecords =
1379+ this . idbConfigs ?. useGetAllRecordsForGetRange &&
1380+ ! forceDisableGetAllRecords ;
13771381 if (
13781382 shouldUseGetAllRecords &&
13791383 ! ! this . _store . getAllRecords &&
@@ -1392,7 +1396,12 @@ class IndexedDbIndex extends DbIndexFTSFromRangeQueries {
13921396
13931397 return IndexedDbProvider . WrapRequest (
13941398 this . _store . getAllRecords ( query_options )
1395- ) ;
1399+ ) . then ( ( result ) => {
1400+ if ( ! ! result ) {
1401+ ( result as any ) . isFromNewGetAllReverseMethod = true ;
1402+ }
1403+ return result ;
1404+ } ) ;
13961405 }
13971406
13981407 const req = this . _store . openCursor ( keyRange , reverse ? "prev" : "next" ) ;
0 commit comments