url 404 and retry always 404
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- dart, flutter
- Domain
- mobile-dev
Research direction
Start with the CachedNetworkImage entry point, especially its errorListener, errorWidget, and refresh behavior after _syncImage calls setState. Reproduce the sequence where the initial URL returns 404, the URL is synchronized, and the widget is refreshed; done means the refreshed image no longer reports the cached 404 when the URL is available.
Written by the indexing model from the issue text.
Description
💬 Questions and Help
Here I'm using cached_network_image to loading network image. It may not exists with the giving image url, when I get 404 from errorListener, I async image to the url to make sure url is available. After that I refresh the CachedNetworkImage, still get error 404 from errorWidget.
Widget imgWidget() {
return CachedNetworkImage(
imageUrl: _imageUrl,
imageBuilder: (context, imageProvider) {
return Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: widget.fit,
),
),
);
},
placeholder: (context, url) {
return widget.placeholder;
},
errorWidget: (context, url, error) {
return widget.placeholder;
},
errorListener: (e) {
if (e is HttpException) {
logger.d('----- errorListener ${e.uri.toString()} - ${e.message}');
if (e.message.contains('404')) {
_syncImage();
}
} else {
logger.d('Image Exception is: ${e.runtimeType}');
}
},
);
}
_syncImage() async {
HttpManager().syncImageToCdnUrl(_imageUrl).then((_) {
setState(() { });
}).catchError((onError) {
logger.d(onError);
});
}
- Dominant language
- Dart
- Stars
- 810
- Forks
- 510
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Baseflow/flutter_cache_manager
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Baseflow/flutter_cache_manager#450 · 9 comments · 8 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
Baseflow/flutter_cache_manager#507 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
Baseflow/flutter_cache_manager#501 · 1 comment · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Baseflow/flutter_cache_manager#500 · 1 comment · 3 reactions ·
All issues in Baseflow/flutter_cache_manager
Similar issues
-
ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
error Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Bug Flutter User Feedbacks
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
getsentry/sentry-dart#4042 · 1 comment ·
-
team-infra
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100