Skip to content

Conversation

@monsieurtanuki
Copy link
Contributor

@monsieurtanuki monsieurtanuki commented Mar 8, 2025

This #2052 fix is made of 2 separate parts.

One part is saying "No!" to forever loops: we assume that after trying to display on multiple worlds, if we keep trying it's because we'll never get an exit permit. And in that case we send an exception, which is slightly more refined than an ANR.

The second part deals more specifically with labels.
Only in the "no rotation" case we computed if the label was visible or not.
That means that in all non-0 rotation cases, we presumed that the label was visible, hence the forever loops.
Now we roughly compute cases when the label is invisible in all rotations. No more forever loops for labels.

Impacted files:
* `feature_layer_utils.dart`: introduced a max number of world replication tries, in order to avoid forever loops and ANRs
* `label.dart`: lazily computed an exit case when the rotation is not 0
@JaffaKetchup JaffaKetchup requested a review from a team March 8, 2025 11:16
@JaffaKetchup JaffaKetchup changed the title fix: 2052 - remove ANRs for labels fix: prevent infinite looping when polygon labels displayed on rotated map Mar 8, 2025
@JaffaKetchup JaffaKetchup linked an issue Mar 8, 2025 that may be closed by this pull request
Replace thrown exception in case of infinite loop with a `StackOverflowError`
Prepare for v8.1.1 release
Copy link
Member

@JaffaKetchup JaffaKetchup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks :). I agree having both is the best solution here as well. I'm releasing this as a hotfix immediately due to the impacts of the bug.

@JaffaKetchup JaffaKetchup enabled auto-merge (squash) March 8, 2025 11:46
@JaffaKetchup JaffaKetchup merged commit 31c41ed into fleaflet:master Mar 8, 2025
7 checks passed
@monsieurtanuki
Copy link
Contributor Author

Thank you @JaffaKetchup for your quick review and release!

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.

Labelled polygons cause fatal crash when map rotated

2 participants