Baseflow / Baseflow/flutter_cache_manager

removeFile don't remove line into database

Aperta
#268 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub
type: bug
Lingua principale
Dart
Stelle
809
Fork
510
Merge medio
6m
PR unite (30g)
1

Descrizione

## 🐛 Bug Report

When i call the `removeFile()` i see that the cached file is deleted into `/data/user/0/fr.serialtrip/cache/libCachedImageData`
But not into the database **libCachedImageData.db**

When I see the code, i don't understand. Is it a bug ?

> Future removeCachedFile(CacheObject cacheObject) async {
final provider = await _cacheInfoRepository;
final toRemove = [];
unawaited(_removeCachedFile(cacheObject, toRemove));
await provider.deleteAll(toRemove);
}

With this code `unawaited(_removeCachedFile(cacheObject, toRemove));` it's impossible to delete the IDs from database (SQLite in my case) because it's not an await. So the toRemove is empty on the next line.

### Configuration

**Version:** 2.1.1

**Platform:**
- [x] :robot: Android

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start at removeCachedFile(CacheObject cacheObject) and trace _removeCachedFile to see when IDs are added to toRemove. Verify the database deletion occurs after that asynchronous work completes, then reproduce the Android cache-removal case and confirm both the cached file and its database row are removed.

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

Valutazione

Stack tecnologico
dart, flutter, sqlite
Ambito
database, mobile
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.