We should consider adding a 'preview' flag to video filenames, to make researcher-generated/testing videos a little easier to identify and filter out.
Explanation
I encountered the problem of not being able to differentiate preview and 'real' videos while looking at our set of incomplete video uploads, and trying to understand where they came from and how to handle them. It's possible that a lot of our incomplete video uploads come from researchers previewing their own studies and exiting the browser tab while the recording is in progress. For this reason, it might be nice to have a job that deletes any partial uploads of preview video recordings after a short time (a few days?).
The reason for differentiated these from non-preview partial uploads is that we may want to be more careful about deleting non-preview uploads, e.g. in case we want to recover an incomplete upload from a real participant.
Implementation
Here's how we currently name the videos:
_generateVideoId() {
return [
this.get('frameType') === 'CONSENT' ? 'consent-videoStream' : 'videoStream',
this.get('experiment.id'),
this.get('id'), // parser enforces that id is composed of a-z, A-Z, -, ., [space]
this.get('session.id'),
+Date.now(), // Timestamp in ms
Math.floor(Math.random() * 1000)
].join('_');
},
If we were to add in a 'preview' flag, I would suggest adding it before the date timestamp or after the final random number. This is because we have some regex in the AWS Lambda function (and maybe in the lookit-api?) that parses the video filename to get the various bits of meaningful information (study/frame/response IDs), so putting the 'preview' string after those bits of info will be less disruptive to that existing code.
Summary
We should consider adding a 'preview' flag to video filenames, to make researcher-generated/testing videos a little easier to identify and filter out.
Explanation
I encountered the problem of not being able to differentiate preview and 'real' videos while looking at our set of incomplete video uploads, and trying to understand where they came from and how to handle them. It's possible that a lot of our incomplete video uploads come from researchers previewing their own studies and exiting the browser tab while the recording is in progress. For this reason, it might be nice to have a job that deletes any partial uploads of preview video recordings after a short time (a few days?).
The reason for differentiated these from non-preview partial uploads is that we may want to be more careful about deleting non-preview uploads, e.g. in case we want to recover an incomplete upload from a real participant.
Implementation
Here's how we currently name the videos:
If we were to add in a 'preview' flag, I would suggest adding it before the date timestamp or after the final random number. This is because we have some regex in the AWS Lambda function (and maybe in the lookit-api?) that parses the video filename to get the various bits of meaningful information (study/frame/response IDs), so putting the 'preview' string after those bits of info will be less disruptive to that existing code.