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

do not reload errored tiles #6813

Merged
merged 2 commits into from
Jun 15, 2018
Merged

do not reload errored tiles #6813

merged 2 commits into from
Jun 15, 2018

Conversation

mollymerp
Copy link
Contributor

fix #6783

errored tiles were being reloaded, and their state was being changed from errored -> reloading which results in tile.hasData() to return true, preventing the existing parent tiles from being retained correctly.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • post benchmark scores
  • manually test the debug page

@ryanhamley
Copy link
Contributor

Does this affect #6768 at all?

@mollymerp
Copy link
Contributor Author

@ryanhamley no, this doesn't change the behavior of #6768 as far as I can tell

@@ -215,7 +215,7 @@ class SourceCache extends Evented {
this._cache.reset();

for (const i in this._tiles) {
this._reloadTile(i, 'reloading');
if (this._tiles[i] && this._tiles[i].state !== "errored") this._reloadTile(i, 'reloading');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the first part of the condition necessary, since we're already iterating through the keys of this._tiles?


t.ok(reloadTileSpy.notCalled);

t.end();
Copy link
Contributor

Choose a reason for hiding this comment

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

I had to dig in a bit to convince myself that test would cause reload() to be executed. To make it more obvious, could we have loadTile load one successful tile and one errored tile, and then make sure that we have only one call to _reloadTile?

@anandthakker
Copy link
Contributor

👍 🐑

@mollymerp mollymerp merged commit 09e8617 into master Jun 15, 2018
@mollymerp mollymerp deleted the fix-6783 branch June 15, 2018 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mapbox not able to change the style of vector tiles at run time
3 participants