Baseflow / Baseflow/flutter_cache_manager
`getFileFromCache` future does not resolve sometimes on android
- 主要语言
- Dart
- 星标
- 809
- 派生
- 510
- 平均合并
- 6 分钟
- 30 天内合并 PR
- 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