Unawaited cache-hit metadata update can surface iOS SQLite errors as unhandled
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- dart
- Área
- databases, mobile-dev
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐛 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.
- Lenguaje dominante
- Dart
- Estrellas
- 812
- Forks
- 511
- Merge medio
- 28 min
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Baseflow/flutter_cache_manager
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Baseflow/flutter_cache_manager#450 · 9 comentarios · 8 reacciones ·
Los mantenedores suelen responder en 1 día
-
Retaining original file namesAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Baseflow/flutter_cache_manager#508 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 48/100
Baseflow/flutter_cache_manager#507 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
sqflite_android updateAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 30/100
Baseflow/flutter_cache_manager#501 · 1 comentario · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Baseflow/flutter_cache_manager#500 · 1 comentario · 3 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de Baseflow/flutter_cache_manager
Issues similares
-
Smart charging: USB charger re-assert is starved during BLE scans, so the tablet never dischargesAbiertobug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
decentespresso/decaid#931 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
flame-engine/flame#4067 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mrgnhnt96/zonai#37 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
google/skills_lint.dart#58 ·
Los mantenedores suelen responder en 1 día
-
[BUG] attempt to index nil valueAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
nvim-flutter/flutter-tools.nvim#557 ·
Los mantenedores suelen responder en 1 día