Skip to content

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

@mramato

Description

@mramato

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions