dive
dive copied to clipboard
[BUG] ImageAnnotator `data.ready` is `true` when `local.quadFeature` is `undefined`
Describe the bug
When the init function is called, data.ready isn't set back to false when local.quadFeature is set to undefined. This means that there is a period of time where data.ready === true, but local.quadFeature === undefined, since the following promise that initializes local.quadFeature has not been resolved yet. If you call seek during this period of time, it will throw an error, since it tries to access local.quadFeature.data, but local.quadFeature === undefined.
To Reproduce Steps to reproduce the behavior: 1.Set up the following watcher (pseudocode)
watch(imageData, () => {
if (data.ready) {
seek(0);
}
});
2.Modify imageData somehow
3. See error
Expected behavior
data.ready is false until local.quadFeature is defined.
I understand this is a very circumstantial bug, but I did run across it when using vue-media-annotator, so I thought I'd at least make it known.
ready needs to be added to mediaController.
@subdavis still valid?
Maybe. Nobody has mentioned this in a while.