justinhunt / moodle-filter_poodll

The PoodLL Filter
6 stars 17 forks source link

Possible to overwrite converted file with placeholder #29

Closed ericmerrill closed 6 years ago

ericmerrill commented 6 years ago

The basic jist is that if you make a recording in a textarea somewhere, save, go back in to edit the textarea, and while you are editing it, the conversion/transcoding completes, when you save, the converted file will be overwritten with the poodll placeholder.

This is because when you click to edit, it makes 'copies' of the files in the then current state as the user drafts area, and then when you save, it copies those draft files back into the main file records for the textarea, even if they were overwritten elsewhere in between.

Specific steps to reproduce:

  1. As a student, go into a submission and record a video as you normally would. Note that it has to be pretty long for this to work (I did about 10 minutes).
  2. Save your submission, and if you are doing it right, you will see the Poodle converting thumbnail.
  3. Immediately click to edit the submission.
  4. Just sit for a few minutes. In another browser you can view the submission as a teacher to see when the temp video is replaced with the real video (usually under a minute).
  5. Back in the student view, save your submission again.

Normally this would be the desired behavior when working with files, so this isn't a bug with Moodle's handling IMO, but I think because of the very specific way PoodLL works, there would be a fix available. Since PoodLL works with unique file names, I think it would safe/desireable to overwrite all placeholder instances of a file with the particular file name, including those in draft areas, with the proper contenthash and filesize.

justinhunt commented 6 years ago

Hi Eric.

It took me a while to follow your meaning. But I see what you mean. Yes this would explain the odd ghost that we see which inexplicably never converts.

I am impressed that you understood the whole Poodll flow so closely. I had thought we were overwriting the draft file also, but its possible that we are not. Or that we do not overwrite all instances of the filename match, just the first one. I will look at this before the next release. Thanks for bringing it to my attention