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

Fix StaticGeometryMaterialBatch remove #7163

Merged
merged 4 commits into from
Oct 22, 2018
Merged

Fix StaticGeometryMaterialBatch remove #7163

merged 4 commits into from
Oct 22, 2018

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Oct 17, 2018

Fixes #7160

StaticGeometryMaterialBatch Batch.remove was returning the wrong thing, causing StaticGeometryMaterialBatch to think the updater was removed from a batch it wasn't removed from.

Also cleaned up remove for StaticGeometryColorBatch and StaticOutlineGeometryBatch which weren't returning anything from the remove functions.

@cesium-concierge
Copy link

Thanks for the pull request @hpinkos!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@hpinkos hpinkos requested a review from mramato October 17, 2018 17:31
@mramato
Copy link
Contributor

mramato commented Oct 18, 2018

Thanks @hpinkos!

Since we have some existing unit tests that are simply not checking the return value, please update them to do so, so this doesn't happen again.

@hpinkos
Copy link
Contributor Author

hpinkos commented Oct 18, 2018

@mramato Which unit tests are you referring to? I didn't see any that are using the remove function from the Batch private class

@mramato
Copy link
Contributor

mramato commented Oct 18, 2018

I thought the various specs were calling remove already, but maybe not. Either way it would be good to add something to StaticGeometryPerMaterialBatchSpecs and other similar specs. Entity show issues keep regressing over and over again, so we need to step up our game in this area.

@hpinkos
Copy link
Contributor Author

hpinkos commented Oct 18, 2018

Yeah I should be able to add a unit test of the material batch problem pretty easily.

All of these static batch files could use a major refactor. I had to stop myself from making more changes. They could really benefit from sharing a common parent class. StaticGeometryPerMaterialBatch had this bug because it's remove function was different than the other ones when it should have been the same.

@mramato
Copy link
Contributor

mramato commented Oct 18, 2018

Yep, all for refactoring things down the line when we have time. Right now we just need to stop the bleeding.

@hpinkos
Copy link
Contributor Author

hpinkos commented Oct 18, 2018

@mramato ready

@mramato
Copy link
Contributor

mramato commented Oct 18, 2018

You have an eslint failure

@hpinkos
Copy link
Contributor Author

hpinkos commented Oct 18, 2018

whoops, thanks @mramato! This is ready

expect(scene.primitives.length).toEqual(2);
})
.then(function() {
batch.remove(updater1);
Copy link
Contributor

Choose a reason for hiding this comment

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

When we have time to refactor these things, we should probably have remove return true/false at this level as well so we can test that items are added/removed as expected.

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.

3 participants