Overwolf.media.replays.capture: When passing in -1 as futureDuration, finishedCaptureCallback is not called as expected

Issue Description:
When situation from title happens, the “callback” in overwolf.media.replays.capture (4th argument) is called with a success, but the captureFinishedCallback is never called (and propably no capture created)

Steps to reproduce:
pass in futureDuration -1 to overwolf.media.replays.capture

Expected behaviour:
Either handle the -1 (and maybe negative values in general) gracefully, or give a warning for debugging purpose.
Took me a while to realise that’s the issue when implementing a workaround for conflicting captures.

I als recall there being unexpected behaviour when passing 0 as future or past duration

We will check these edge cases. Thanks.

@Colorfulstan after a quick check, I can see that when the futureDuration param is invalid, like a negative value - it ignore it and mark it as “undefined”. Following that, when futureDuration is not defined, also the captureFinishedCallback is not called.

It’s mentioned also in the docs:

I hope it now makes more sense…

So the future duration should be ignored (read: treated as if 0 was given…which by the way has the same result as in not capturing anything). I would still expect a capture to be created in that case if there is a duration with past duration value.

The request callback indicates that the call was successful and valid, so I expect a highlight to be captured.
But that’s not the case.

To make clear why this is bugged behaviour imo:
If I actually want to have a capture only using the past duration, I need to pass in 1 as futureDuration because of the initially explained bug when passing in something lower or equal 0.

I don’t think I misunderstood the documentation, it is just not working as expected/documented.

I did a quick check, and when I set a future duration to a negative value, it captured the Video.
I didn’t check all the options, etc. But the basic check worked.

If it reproducible at your end, can you please give me the exact steps to reproduce?

Where do you get the data for the video then?

You mentioned the finishedCaptureCallback is not called when a negative value is passed.
So you get it from the “callback“?

That would mean this might not be bugged but a very unexpected API.

Am I supposed to use the finishedCaptureCallback to receive the data when using futureDuration, but the other callback if not?

@Colorfulstan I’m not saying it’s a perfect API… I just did a quick check. I checked the Video folder to see if a video was captured. If I remember correctly, the finishedCaptureCallback was never called on that case. But when I called stopCapture. I got the metadata of the captured video.

To understand this issue correctly, I can open a bug if needed; I just want to understand the exact details. Can you please try to reproduce it at your end, and tell me the detailed steps. Please also check if the finishedCaptureCallback is called or not, if the video file is created or not, and if on stopCapture you get the video details.

With all the above info, I will understand the full picture and create the right bug for the R & D/QA team.


Setup 1)
Pass in negative futureDuration

  • finishedCaptureCallback not called
  • no idea if the regular callback then includes the data (as I assumed it will always be available in finishedCaptureCallback).
  • callback gets fired

Setup 2)
Pass in positive futureDuration

  • both callbacks called

I can’t spend any more time on QA here, sorry.
We added a workaround and I just wanted you to be aware.

@Colorfulstan sure.
I created a bug on this.
I will update you here with the progress in the future.