Baseflow / Baseflow/flutter_cache_manager

`getFileFromCache` future does not resolve sometimes on android

オープン
#390 コメント 2 件 リアクション 4 件 担当者 0 名 GitHub で見る
主要言語
Dart
スター
809
フォーク
510
平均マージ
6分
マージ済み PR(30日)
1

説明

Hey together,

there is an issue with the flutter_cache_manager which is only happening sometimes on android. At this point we are not sure under wich circumstances, but most of the times when something changes on Android (e.g. Application switching, Updating the App version)

My code looks like this:
```dart
logMessage(
'Loading file from cache...',
extras: {'File': url},
);
var file = await _cacheManager.getFileFromCache(url);

if (file == null) {
logMessage(
'File not in cache. Marked for retrieval.',
extras: {'File': url},
);
futures.add(_repository.retrieveAsset(url)
..then((file) async {
logMessage(
'File successfully retrieved. Caching...',
extras: {'File': url},
);
await _cacheManager.putFile(url, file);
logMessage(
'Successfully cached file.',
extras: {'File': url},
);
}));
} else {
logMessage(
'Found file in cache.',
extras: {'File': url},
);
}
```
The logs are only going until `Loading file from cache...`, after that the class is never returning any logs. So it is likely that the error is in `var file = await _cacheManager.getFileFromCache(url);` as the future never resolves. Moreover the problem is not reproduceable on any device as long as the debugger is attached. At this point I am not sure what to do anymore. Maybe you have any ideas?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

getFileFromCache(url) から開始し、デバッガーを切り離した状態でアプリケーションを切り替えたとき、または更新したときに、Android 上で future が完了するかを調査してください。レポートにはファイル名やテスト名が記載されていないため、まず再現可能なライフサイクルシナリオを確立し、その中で future の完了が止まる箇所を追跡してください。そのシナリオでキャッシュ検索が確実に解決されるか、エラーを報告すれば完了です。

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

評価

技術スタック
dart, flutter
領域
mobile
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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