Skip to content

Fix for premature staging file deletion for issue#76

Deepa Kumari requested to merge az/dk-az-fix-file-premature-deletion into master

Issue: Staging file is getting deleted prematurely when there is an issue in POST files/metadata. Problem: Staging file was getting deleted before the function is completely finished. So in the next iteration the file will not be available failing the next requests.

Resolution:

  1. Delete the file as the last step of saving metadata process.
  2. Catch and ignore if any exception is thrown while deleting the staging file (rare scenario)
  3. Check if the staging file is present before attempting to delete the record.

Implementation:

  1. All three above changes made inside saveMetadata
  2. Test added to cover the exceptional scenario.

The issue is explained in more detail here: #76 (closed)

Edited by Deepa Kumari

Merge request reports

Loading