Baseflow / Baseflow/flutter_cache_manager
`getFileFromCache` future does not resolve sometimes on android
- Ngôn ngữ chính
- Dart
- Star
- 809
- Fork
- 510
- Merge trung bình
- 6 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
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?
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu tại getFileFromCache(url) và điều tra việc hoàn tất future trên Android khi ứng dụng được chuyển đổi hoặc cập nhật, trong khi trình gỡ lỗi đã được ngắt kết nối. Báo cáo không cung cấp tên tệp hoặc bài kiểm thử nào, vì vậy trước tiên hãy thiết lập một kịch bản vòng đời có thể tái hiện và theo dõi nơi future không còn hoàn tất. Được xem là hoàn thành khi việc tra cứu cache được giải quyết hoặc báo lỗi một cách đáng tin cậy trong kịch bản đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- dart, flutter
- Lĩnh vực
- mobile
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100