Unawaited cache-hit metadata update can surface iOS SQLite errors as unhandled
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 68/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- dart
- Bereich
- databases, mobile-dev
Rechercherichtung
Start in flutter_cache_manager/lib/src/cache_store.dart at CacheStore._getCacheDataFromDatabase and the unawaited _updateCacheDataInDatabase call. Review the repository updateOrInsert path, then create the isolated cache-hit test described in the issue with a failing update. Done means the metadata failure is observed or handled without an unhandled asynchronous exception while the cached file remains usable.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🐛 Bug Report
An iOS production build reported an unhandled SqfliteDatabaseException while displaying a cached network image. SQLite returned code 14 ("unable to open database file") for an UPDATE cacheObject ... WHERE _id = ?. Sentry recorded handled: no via PlatformDispatcher.onError. Image URL, SQL arguments, and user/device identifiers are omitted.
This resembles #494. A distinct concern is the cache-hit path in CacheStore._getCacheDataFromDatabase: it calls _updateCacheDataInDatabase(data!) without awaiting or handling the returned Future. If that write fails, the error can escape independently of the image-loading error path. The call is still present on main: https://github.com/Baseflow/flutter_cache_manager/blob/main/flutter_cache_manager/lib/src/cache_store.dart#L120-L127
The reason iOS could not access the SQLite file in this event is unknown; this report focuses on the unhandled asynchronous update.
Expected behavior
A cache metadata write failure should not produce an unhandled asynchronous exception. The cache manager should handle or surface it through an observed error path while keeping a valid cached file usable where possible.
Reproduction steps
The device event was intermittent in production; I do not have a deterministic device reproduction. An isolated test could create a valid cached file and metadata record, make the repository's updateOrInsert throw, then call CacheStore.getFile after a memory-cache miss. The cache-hit metadata update's Future is currently left unobserved.
Observed stack excerpt:
wrapDatabaseException (sqflite_platform_interface/src/platform_exception.dart:12)
SqfliteDatabaseMixinExt._txnRawUpdateOrDelete (sqflite_common/src/database_mixin.dart)
BasicLock.synchronized (synchronized/src/basic_lock.dart)
SqfliteDatabaseMixin.txnSynchronized (sqflite_common/src/database_mixin.dart)
Configuration
Version: flutter_cache_manager 3.4.2; cached_network_image 4.0.0; sqflite_darwin 2.4.3+1
Platform:
- 📱 iOS 18.6.2
- 🤖 Android
Flutter 3.47.2 / Dart 3.13.2.
- Vorherrschende Sprache
- Dart
- Sterne
- 814
- Forks
- 513
- Ø Merge
- 28 Min.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Baseflow/flutter_cache_manager
-
JsonCacheInfoRepository: FormatException: Unexpected end of input (at character 1) ^Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Baseflow/flutter_cache_manager#450 · 9 Kommentare · 8 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
existsSync in CacheStore._removeCachedFile blocks the main isolate (ANR on Android)Evtl. vergeben @yamashita-room-335 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 22/100
Baseflow/flutter_cache_manager#539 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
Baseflow/flutter_cache_manager#508 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 48/100
Baseflow/flutter_cache_manager#507 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
sqflite_android updateOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 30/100
Baseflow/flutter_cache_manager#501 · 1 Kommentar · 3 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in Baseflow/flutter_cache_manager
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
djazairdev/wilayas#22 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 80/100
rajput-hemant/calculator#199 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
leancodepl/app-rating#35 ·
-
Mobile login: "Sign In" button is squashed to 16 px with its label cut while the keyboard is openOffenai-driven-qa bug claude
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
linagora/tmail-flutter#4976 ·
Maintainer antworten meist innerhalb von 1 Tag