Closed cjchirag7 closed 4 years ago
Fixes Issue-324 of caMicroscope repository, which reads 'File already exists error even after the slide is deleted'
@birm The functional test for 'Delete a slide' step has been updated, to test this feature.
@cjchirag7, Using system calls (such as 'rm' call to remove files, in this situation) is never advised to be implemented and is always kept as a last resort. This is not supported by all operating systems and putting up a condition to check the operating system and then executing respective remove commands is also not feasible.
Also error handling of system calls becomes very difficult in OS like windows and shared server based PCs.
A better fix was already done at PR-341 and PR-25.
Please consider the above problems before merging.
@Vedant1202 , yeah, you 're right. I have fixed this by using 'fs' module to remove the file. This would perform the delete operation, irrespective of the OS. I think, now there are no major issues with this PR. #25 has some major problems with the route security, which I have commented on the PR. These should be looked carefully, before performing any merge.
@birm , what are your thoughts ?
I don't understand, why the travis build is not being shown now ? :confused:
ah, I have no idea. This may mean we have to go back to the stone age and check out the code and run tests manually :laughing:
Closed in favor of #24 and its linked PRs. Thank you for the work in any case.
I have used the 'fs' module to delete the file simply using the asynchronous unlink() function, when data gets deleted from DB successfully. But this requires ./images to be mounted in 'ca-back' container. For this, PR-118 of Distro repository should be merged first.