Skip to content

Conversation

@IgorKhramtsov
Copy link

@IgorKhramtsov IgorKhramtsov commented Mar 20, 2024

Issue

If an exception is thrown during loader execution - future with error result will be stuck in the _pending map and it will be returned every time putIfAbsent is called. There is no way to evict it either, since evict method only affects _cache map.
The exception in loader may be thrown in case of network error when SvgNetworkLoader is used.

Change

This change adds a catchError handler to remove future from the _pending map in case of failure. Also a regression test is added that will fail without this fix.

@IgorKhramtsov IgorKhramtsov changed the title fix(cache): clear _pending in case of exception fix(cache): remove entry from _pending in case of exception Mar 20, 2024
@zanderso
Copy link
Contributor

zanderso commented Nov 1, 2024

Hi there, The Flutter team is now maintaining this package in the flutter/packages repository at this location. We'd appreciate it if you could direct this PR to that location instead. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants