Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception caught by image resource service #3

Closed
ricardobarrospereira opened this issue Oct 14, 2023 · 5 comments
Closed

Exception caught by image resource service #3

ricardobarrospereira opened this issue Oct 14, 2023 · 5 comments
Labels
bug Something isn't working flutter_map_cache

Comments

@ricardobarrospereira
Copy link

Hi! I'm new to Flutter so I am probably missing something, but I am trying to use FileSystem cache exactly as it is showing on this example, and it is showing a lot of the exceptions below every time the map loads:

════════ Exception caught by image resource service ════════════════════════════
DioException [request cancelled]: The request was cancelled.

It doesn't show any other detail, only those lines repeating multiple times. This is happening both with File System and In Memory cache, for Android and iOS simulators.

What could be the cause of this?
Thanks!

@MaxiStefan
Copy link

Hi, i've also just started using this caching plugin and I am using the hive storage. Also ran into this exception

@josxha
Copy link
Owner

josxha commented Oct 20, 2023

Hi @ricardobarrospereira and @MaxiStefan.
Thanks for the issue and sorry for my late response. I've had lots of things to do the last week.

Quick answer:

You can just ignore those exceptions in the console. The plugin still works as intended and I'm going to remove those console logs in the next version.

Longer answer:

flutter_map version 6 introduced an awesome new feature to cancel tile requests that aren't needed any more before they finished. This saves bandwidth, supports faster map loading times on the web and decreases costs on map providers.

Tile requests are cancelled for example if you zoom in or out quickly and "skip" some zoom levels. The tiles from the between zoom level will get cancelled. And end up in a thrown exception that doesn't get caught internally. This is no problem and everything should work fine but I agree that it's confusing to users. I will release an update as soon as I find the time. For now you can just ignore it.

I hope that helps and sorry for this. (:

@josxha josxha closed this as completed in 9a70ead Oct 20, 2023
@josxha
Copy link
Owner

josxha commented Oct 20, 2023

I published version 1.3.1 to pub.dev that removes those exceptions from the console. 👍

@maotou316
Copy link

I am using version 1.3.1, but the issue still persists.

DioException (DioException [request cancelled]: The request was cancelled.)

image

@josxha
Copy link
Owner

josxha commented Nov 2, 2023

@maotou316 Thanks for the comment. I created #5, since the problem you are mentioning has actually a different cause and is vs code specific. It's a bug in the vs code debugger and can be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flutter_map_cache
Projects
None yet
Development

No branches or pull requests

4 participants