Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Unawaited cache-hit metadata update can surface iOS SQLite errors as unhandled

オープン
#535 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
dart

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

🐛 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.

主要言語
Dart
スター
812
フォーク
511
平均マージ
28分
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Baseflow/flutter_cache_manager のほかの issue

Baseflow/flutter_cache_manager の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。