Baseflow / Baseflow/flutter_cached_network_image

Crashlytics fatal error: Connection reset by peer

Open
#804 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.6k
Forks
731
Avg merge
3d 9h
Merged PRs (30d)
1

Description

## 🐛 Bug Report
Firstly, thank you for the wonderful package
Secondly, my problem)

We are using CacheNetworkImage in our application and recently we had several Crashlytics crashes with description "
Connection reset by peer". It is look like this issue https://github.com/flutter/flutter/issues/112706.
Screenshot 2022-12-01 at 16 04 48

The application has screen with list of products and screen with detail information about product. Both of screens use CacheNetworkImage. I don't know why but fatal error occurs on detail screen and have tried to reproduce the crash but i wouldn't be lucky. I can guess that it happens because MultiImageStreamCompleter doesn't cancel a subscription ``
codec.listen((event)
``. Possibly the error occurs when the subscription is still alive but _listeners is empty. In this case MultiImageStreamCompleter can't handle an exception in `reportError` function:
```
if (!handled) {
FlutterError.reportError(_currentError!);
}
```
May be need to call `cancel` method in __maybeDispose for the subscription? Like it is done with _chunkSubscription?

Devices: Samsung, Xiaomi, Huawei, Vivo
Platforms: Android 8, 10, 11, 12

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.