mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-26 19:31:45 +02:00
fix(search): let latest live queries supersede cancelled requests
This commit is contained in:
@@ -611,6 +611,9 @@ class PlatformBridge {
|
||||
}) {
|
||||
for (final entry in _customSearchInFlight.entries.toList()) {
|
||||
if (entry.key == exceptKey || entry.value.scopeKey != scopeKey) continue;
|
||||
// A cancelled request must not be reused if the user types its query
|
||||
// again before the native cancellation finishes.
|
||||
_customSearchInFlight.remove(entry.key);
|
||||
_cancelExtensionRequestUnawaited(entry.value.requestId);
|
||||
}
|
||||
}
|
||||
@@ -1824,7 +1827,8 @@ class PlatformBridge {
|
||||
'request_id': requestId,
|
||||
});
|
||||
final decoded = _decodeMapListResult(result, 'customSearchWithExtension');
|
||||
if (generation == _lookupCacheGeneration) {
|
||||
if (generation == _lookupCacheGeneration &&
|
||||
_customSearchInFlight[cacheKey]?.requestId == requestId) {
|
||||
_putMemoryCachedMapList(
|
||||
_customSearchCache,
|
||||
cacheKey,
|
||||
|
||||
Reference in New Issue
Block a user