Clearing exports and investigations

While exporting video using Mobile SDK I must create investigation. I know I can clean it afterwards like this and that’s what I’m currently using:

_client.Connection.InvestigationExports.DeleteInvestigationExport(export, TimeSpan.FromSeconds(_client.RequestTimeout));
_client.Connection.Investigations.DeleteInvestigation(_investigationId.Value, TimeSpan.FromSeconds(_client.RequestTimeout));

But is there an option to check if there are any leftovers from previous runs and flush them?

Milestone Development will start an investigation. Let us get back to you when there’s update.

Thanks for taking care of this topic. We’ve also noticed that this methods lefts export files that will stay on the server and cannot be flushed by Mobile.Sdk. Or at least I don’t know how to do it. And it’s troubling as we need to keep track of them or we’ll quickly reach limits.

Hi @RChojnacki,

Desired funcionality (“option to check if there are any leftovers from previous runs and flush them”) does not exist. Investigations are just not designed as a single-instance thing. Instead - customers usually want to have various different investigations and keep them for a while.

What I can recommend is to make a one-time modification in your settings, to enable retention policy. You can do that from Management Client → Mobile Server → Investigations:
image

To try address your other issue (leftover files), you can observe how Web Client deletes investigations (Browser → F12 → Network tab → Playload). I just made sure that C:\ProgramData\Milestone\XProtect Mobile Server\Exports only contains a couple of empty folders after deleting all investigations via Web Client.
Mobile SDK should behave quite the same. Mobile Client and Web Client rely on it internally.