dive icon indicating copy to clipboard operation
dive copied to clipboard

[BUG] ImageAnnotator `data.ready` is `true` when `local.quadFeature` is `undefined`

Open jjnesbitt opened this issue 4 years ago • 3 comments

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.

jjnesbitt avatar May 17 '21 17:05 jjnesbitt

ready needs to be added to mediaController.

subdavis avatar May 17 '21 19:05 subdavis

@subdavis still valid?

waxlamp avatar Jan 12 '22 20:01 waxlamp

Maybe. Nobody has mentioned this in a while.

subdavis avatar Jan 12 '22 22:01 subdavis