CompositeProperty throws if TimeInterval's data is not a Property
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
[Sandcastle example](https://sandcastle.cesium.com/#c=nVfrbts2GH0VIr/k1ZOt3NY6STHP7YoMTmPEWYthHgpaYmwiFCmQlN20yLvvkNTNjYN2MwKJIr8bz3fNhmqy4WzLNLkgkm3JhBle5vEHvxctDlL/PVHSUi6ZXhz0ydeFJITLO/Wb+jwid1QY1ieDwRtu6FIwchlOyJZnK2YdrWGCpZYreSkznlKr9B62hgiiKyrPu1alyMaS59SyEbG69FzkrfRc1B+Ayzhiy7SGmTOtNjxj0FLdJtUM3B+VFtltIIl6/YV87J0t5EIOBpUwwVdry+WKLKlhGYEpdg3DSkkKZbjTspABrNikTLJ4JdSSxcxzT2vmC2/kruSMFXYN84ynMAqCsTBkyfDOvJrKdpIBj6JgVMd7lXlJtxA0XoHa2Oo+u1rnzHqZmspM5USW+RIONgyXulOapICLG8ukJZqZUlgDXRVUV9SuY8PsjWd97znnYIyOeh3hS1XKzBB1R1QJwTwvhfcCsTxnsBtRZSzVFmZVcv8oBafyDdwQ32mVu0Xk4s0vDofJSZ8c4g+v5LTnVAUZqtgrgmbZnOEamYl8kDhdfbc6Oh36dyeUW7aot5D1La7ovXOtZnX4c0NoQC0DnwZU7i6tE1Kh0vvYa7rFAczya7cvIfnsCaEqGjpVPEeWllrDDz8i0T/hlhVrIZk0e/H0+nr2aX57PTtDekwVgKuuw2T2jSR4y/JCcJ/0ybAbNLBDIM+JVV2vBnc3Umqq+ItS+a2KAvz+njW87xCxGpATWgdhynUKeZoU1CLWJeoDUgJefnApsWYufVwc3pUylIFU5UVp2QR8wjH+7tMzAjh9Arv6EJzx0vRCPXLhUmhVMG0fdkvZBHJc+rJZlcSzisxDTHxGRI6dg294htf5hYsjt3pxQY5PKg1Bh1NKpWld4BPGqpuwH/EgNBDb4Nbvxq/7tTHsfrxZPRvJ7vBbZYf/Uxt5gXv+d5V1WewEJMRiReVRSHO20oy1auE8qAqOIz+RJD7B0yOYKhNV2PYaQ+DmLnmoTSjeTwi7vpDs8071inpgPRkOISn55WT49BZcIh43VOyGjUvJy+ok+rqD28hj3W/3VBG2DltEzRy7lxKhm7Gsbnf1aUYtHTXoVduPtU11GMe1YcZ5sLGl3g2p5hgGg7FATwldDhlXKND4uGY0XRND8wI9aMvIqsrKuLp8SGfUH9jBvJb2prV1T+wkQf6INKTY4Z+ZmPMv6NAv++12qoRqu/DEfcW3N+P389n45u372w6lKq2rKJM9DH+9nU6vPz6l/cgzux6Ro+bkcRfIR/fQzJaoNTWkOHgMBWoSqktVIQHAQxvNjQNCF+pE+TM16eckOYyTZHj66qiP0hEPX706fnmc9MkwHjZ9c5zakgrxUPup1RzUVFZcPO+WtrFXtHRDuaBLLtyHVWFcoag5TUhTEzZ3O7T3f5d59FzkwwXVWBb9HdD90RTZrTAhR9yzcZJf/ONe4W5/GuaniQrjrMHdj3Z7wzEwjkur3BCYBnQrxyrNgVLVv+p5rnFlrjYsx7lHokO6A8QHhnYJdK7b86Z31JJa+6eKhkkucJNCUDTSXGVMON9oVmDYcjNX1/EkEDTJVGo+IouDOB7Mfdai8tKBJzGDIHfMdbX6hCWmwiVm8sCcc0zDZT5rk/H02B89NkbO12rrDUAXXrvoQLXg8p74ph8KRYboIQmmRdcxsEa4OqSMh8qxNcbiPkqUAbaktgGhrTkVO0DOlHhwGt4Jtb2qCBokm8DBgLudqa2b24dx0oRO+r2a8Fj3gW2oCMmwubQvBQf9g3NjHwR7XYv8lWMkwHRaahEBastwb5hlBssyvWeYwIypi/H5oMt6nvEN4dnFnv+LSCqoMTi5K4VHf3Hw+nwA+iesAoGCmed6w7SgD45snbyehs04js8H+NzPaZUSSwplzU3aM5/yhQpZfsVk+a3+zvpf)
Browser: Chrome
Operating System: Win10
I started with the Sandcastle demo for Interpolation, thinking it would be an easy way to see how CompositeProperty works. (Incidentally, there is no current Sandcastle demo that uses this class.) It's throwing and the error message doesn't make it obvious why.
Try to pause around `property.intervals.addInterval(interval);` with the debugger and step through until you get to [CompositeProperty#subscribeAll](https://github.com/CesiumGS/cesium/blob/1.75/Source/DataSources/CompositeProperty.js#L17). `eventHelper.add` throws when `interval.data.definitionChanged` is undefined.
One of two things needs to happen: if `data` is an arbitrary value with no `definitionChanged` event, skip the `subscribe` step; OR, update the docs for `CompositeProperty` (or I guess `TimeInterval`? probably not?) to specify that `data` must be a `Property`.
Contributor guide
Research direction
Reproduce the issue with the linked Sandcastle interpolation example, then inspect Source/DataSources/CompositeProperty.js at CompositeProperty#subscribeAll and the call from property.intervals.addInterval(interval). Decide whether non-Property interval data should be accepted or the CompositeProperty/TimeInterval documentation should require a Property; done when the reported throw is resolved or the contract is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100