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

[BUG] TileLayer.fallbackUrl not attempted when FMNIP fails to decode a non-image #1667

Closed
JaffaKetchup opened this issue Sep 27, 2023 · 0 comments · Fixed by #1662
Closed
Labels
bug This issue reports broken functionality or another error P: 2 (soon™?)

Comments

@JaffaKetchup
Copy link
Member

What is the bug?

The decode method called inside FlutterMapNetworkImageProvider._loadAsync has a try-catch block around it to attempt to catch some errors and use the fallback URL.
However, errors within the decode method itself are asynchronous and are not caught by this block.
This means that an error when decoding, such as when decoding a non-image (eg. an error or login page) even with a 200 OK response (which is technically a server misconfiguration, but we should be as flexible as possible), does not trigger the usage of fallback URL.

How can we reproduce it?

Set the urlTemplate to any HTML page, such as 'https://google.com'. Set the fallbackUrl to a real tile server serving known images. Errors are thrown and the fallback URL is not attempted.

Do you have a potential solution?

See commit c2ac7bc in #1662.

Platforms

All

Severity

Erroneous: Prevents normal functioning and causes errors in the console

@JaffaKetchup JaffaKetchup added bug This issue reports broken functionality or another error P: 2 (soon™?) labels Sep 27, 2023
@JaffaKetchup JaffaKetchup added this to In progress in v6 Release Planning Sep 27, 2023
@JaffaKetchup JaffaKetchup moved this from In progress to Done in v6 Release Planning Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue reports broken functionality or another error P: 2 (soon™?)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant