Baseflow / Baseflow/flutter_cache_manager

SqfliteDatabaseException attempt to write a readonly database (code 1032 SQLITE_READONLY_DBMOVED[1032]))

Offen
#359 2 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Dart
Sterne
809
Forks
510
Ø Merge
6 Min.
Gemergte PRs (30 T.)
1

Beschreibung

## 🐛 Bug Report

When using the flutter_cache_manager within Dart 2.15 within Flutter 2 I get sometime this Fail with SQLite.

Error:
SqfliteDatabaseException
DatabaseException(attempt to write a readonly database (code 1032 SQLITE_READONLY_DBMOVED[1032])) sql 'UPDATE cacheObject SET url = ?, key = ?, relativePath = ?, eTag = ?, validTill = ?, touched = ?, length = ?, _id = ? WHERE _id = ?' args [https://asdf.de/img/start_aktion-1_mobil-opti...., https://asdf.de/img/start_aktion-1_mobil-opti...., 57dcb0d0-79e7-11ec-bb36-436c12859413.png, W/"16304a-17dc2bf19ff", 1643284306013, 1642679987235, 1454154, 1, 1]

### Expected behavior

I would like to have a non throwing Error behaviour with the Cache Manager.

### Reproduction steps

Call within InitState method something like this (async):

mainProvider.retrieveStartPageData(mta).then((value) async {
if (value != null) {
if (mainProvider.myHi.length > 0) {
for (var headerImage in mainProvider.myHi) {
await DefaultCacheManager().getSingleFile(
'${Env.value!.imgUrl}${headerImage.imageMobile}');
}
}
}
});

### Configuration

Dart: 2.15
Flutter 2.5

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reproducing the async DefaultCacheManager().getSingleFile calls from initState on iOS and Android with the stated Dart and Flutter versions, then trace the SQLite update that emits SQLITE_READONLY_DBMOVED. Done means the intermittent failure is understood and the cache manager no longer throws in the reported scenario, with regression coverage added.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
dart, flutter, sqlite
Bereich
databases, mobile-dev
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.