Baseflow / Baseflow/flutter_cache_manager
SqfliteDatabaseException attempt to write a readonly database (code 1032 SQLITE_READONLY_DBMOVED[1032]))
- 主要语言
- Dart
- 星标
- 809
- 派生
- 510
- 平均合并
- 6 分钟
- 30 天内合并 PR
- 1
描述
## 🐛 Bug Report
When using the flutter_cache_manager within Dart 2.15 within Flutter 2 I get sometime this Fail with SQLite.
Error:
SqfliteDatabaseException
DatabaseException(attempt to write a readonly database (code 1032 SQLITE_READONLY_DBMOVED[1032])) sql 'UPDATE cacheObject SET url = ?, key = ?, relativePath = ?, eTag = ?, validTill = ?, touched = ?, length = ?, _id = ? WHERE _id = ?' args [https://asdf.de/img/start_aktion-1_mobil-opti...., https://asdf.de/img/start_aktion-1_mobil-opti...., 57dcb0d0-79e7-11ec-bb36-436c12859413.png, W/"16304a-17dc2bf19ff", 1643284306013, 1642679987235, 1454154, 1, 1]
### Expected behavior
I would like to have a non throwing Error behaviour with the Cache Manager.
### Reproduction steps
Call within InitState method something like this (async):
mainProvider.retrieveStartPageData(mta).then((value) async {
if (value != null) {
if (mainProvider.myHi.length > 0) {
for (var headerImage in mainProvider.myHi) {
await DefaultCacheManager().getSingleFile(
'${Env.value!.imgUrl}${headerImage.imageMobile}');
}
}
}
});
### Configuration
Dart: 2.15
Flutter 2.5
**Platform:**
- [x] :iphone: iOS
- [x] :robot: Android
贡献指南
调研方向
首先,使用所述的 Dart 和 Flutter 版本,在 iOS 和 Android 上复现 initState 中的异步 DefaultCacheManager().getSingleFile 调用,然后跟踪发出 SQLITE_READONLY_DBMOVED 的 SQLite 更新。完成的标准是理解间歇性失败的原因,确保 cache manager 在报告的场景中不再抛出异常,并添加回归覆盖。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- dart, flutter, sqlite
- 领域
- databases, mobile-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100