fix: prevent infinite looping when polygon labels displayed on rotated map#2054
Merged
Conversation
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
Replace thrown exception in case of infinite loop with a `StackOverflowError` Prepare for v8.1.1 release
JaffaKetchup
approved these changes
Mar 8, 2025
JaffaKetchup
left a comment
Member
There was a problem hiding this comment.
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.
Contributor
Author
|
Thank you @JaffaKetchup for your quick review and release! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.