-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] Don't allow style mutations to be overwritten by revalidation #5753
Conversation
@jfirebaugh, thanks for your PR! By analyzing the annotation information on this pull request, we identified @kkaefer, @tmpsantos and @brunoabinader to be potential reviewers |
a4115d5
to
3a8f0dc
Compare
3a8f0dc
to
9030b80
Compare
Rebased on |
9030b80
to
dbc2b8e
Compare
@kkaefer, @tmpsantos and @brunoabinader can one of you review please? |
@@ -67,6 +67,7 @@ class Map::Impl : public style::Observer { | |||
|
|||
std::string styleURL; | |||
std::string styleJSON; | |||
bool styleMutated = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to the Style
object and have it keep track of whether it was mutated itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to do it that way, but the issue is that we want some style mutations to be excluded from this logic, specifically those that AnnotationManager::updateStyle
performs. Adding annotations should not cancel the initial revalidation. (I'll add a test for this.)
* Once we get a fresh style, stop revalidating. * If the style is mutated, stop revalidating and preserve the existing mutations.
577e9e1
to
eb9fe89
Compare
Fixes #5665.
This fix is lenient about the case where the style is mutated between when the loading of a style URL is requested and when it completes. GL JS throws in this case, and native probably should prohibit it as well.