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

Resource silently fails to load if used multiple times. #9093

Closed
mramato opened this issue Aug 13, 2020 · 2 comments · Fixed by #9119
Closed

Resource silently fails to load if used multiple times. #9093

mramato opened this issue Aug 13, 2020 · 2 comments · Fixed by #9119

Comments

@mramato
Copy link
Contributor

mramato commented Aug 13, 2020

Take the below code:

var viewer = new Cesium.Viewer("cesiumContainer");

var resource = new Cesium.Resource("../../SampleData/simple.czml");

resource.head().then(function () {
  return viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
});

Same code in Sandcastle

If you comment out the resource.head() line, it works as expected but obviously you are now losing the head call. Basically, it looks like resources used to be re-usable, but since #8843, they can only ever be used once specifically this line in the PR here: https://github.com/CesiumGS/cesium/pull/8883/files#r470300910

Perhaps something is not being re-initialized on the second call? It can't be a race condition because we wait for the head call to finish before calling load. If I make two identical resources, it works.

CC @lilleyse @OmarShehata

@mramato
Copy link
Contributor Author

mramato commented Aug 13, 2020

resource.clone.head() also works as a workaround. So definitely some undesired state being saved across calls.

@lilleyse
Copy link
Contributor

Perhaps something is not being re-initialized on the second call?

Without looking too closely, this sounds pretty likely.

The original problem was that 3D Tiles was holding onto request objects and it can be fixed in another way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants