Baseflow / Baseflow/flutter_cache_manager

`getFileFromCache` future does not resolve sometimes on android

Aperta
#390 2 commenti 4 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Dart
Stelle
809
Fork
510
Merge medio
6m
PR unite (30g)
1

Descrizione

Hey together,

there is an issue with the flutter_cache_manager which is only happening sometimes on android. At this point we are not sure under wich circumstances, but most of the times when something changes on Android (e.g. Application switching, Updating the App version)

My code looks like this:
```dart
logMessage(
'Loading file from cache...',
extras: {'File': url},
);
var file = await _cacheManager.getFileFromCache(url);

if (file == null) {
logMessage(
'File not in cache. Marked for retrieval.',
extras: {'File': url},
);
futures.add(_repository.retrieveAsset(url)
..then((file) async {
logMessage(
'File successfully retrieved. Caching...',
extras: {'File': url},
);
await _cacheManager.putFile(url, file);
logMessage(
'Successfully cached file.',
extras: {'File': url},
);
}));
} else {
logMessage(
'Found file in cache.',
extras: {'File': url},
);
}
```
The logs are only going until `Loading file from cache...`, after that the class is never returning any logs. So it is likely that the error is in `var file = await _cacheManager.getFileFromCache(url);` as the future never resolves. Moreover the problem is not reproduceable on any device as long as the debugger is attached. At this point I am not sure what to do anymore. Maybe you have any ideas?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start at getFileFromCache(url) and investigate its future completion on Android when the application is switched or updated, with the debugger detached. The report provides no named files or tests, so first establish a reproducible lifecycle scenario and trace where the future stops completing. Done means the cache lookup resolves or reports an error reliably in that scenario.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
dart, flutter
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.