Baseflow / Baseflow/flutter_cache_manager

`getFileFromCache` future does not resolve sometimes on android

Abierto
#390 2 comentarios 4 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Dart
Estrellas
809
Forks
510
Merge medio
6 min
PR fusionados (30 d)
1

Descripción

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?

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
dart, flutter
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.