Bugzilla – Bug 1507
Project may be overwritten by new project without warning
Last modified: 2018-08-20 11:45:28 UTC
If a file is imported into new project, and the file is in the same director as a project with the same name, then saving the project with the default name and location will overwrite to original project without warning. Gale has stated that he considers this to be a blocking issue, so given an initial rating of P2. Following the steps to reproduce, the "correct" behaviour would be the warning: "Error Saving Project" "The project was not saved because the file name provided would overwrite another project.\nPlease try again and select an original name." The error message is not triggered because Audacity thinks that it is the original (old) project that is being saved (because the project name and path of the old and new projects are identical).
Pull request for fix: https://github.com/audacity/audacity/pull/162
Thanks, Steve. Yes I would want to block on this so set as P1 (unless fixing it is problematic in some way). We have a real life case (see URL) where a user lost a recording which was the original project content. I agree given we don't allow overwriting of existing projects unless the project is already open, refusing overwrite should be the response to this case.
DEVEL - FIX MADE https://github.com/audacity/audacity/commit/bf06b0485fa6886f63c21e6c8cab13b8e585a894 Fix in comment #1 was along the right lines, but would have continued to reject a Save of a file initially loaded as an import but later saved with SaveAs. Every place where mFileName was written to needed to be reviewed to see if the flag indicating valid/invalid aup name should change or not.
(In reply to James Crook from comment #3) Testing on dcaba6e 08Sep16 on W10 and Mac El Capitan On both platforms wne I follow the Steps to reproduce an error message is thrown up and the overwrite Save is inhibited.
(In reply to James Crook from comment #3) > Fix in comment #1 was along the right lines, but would have continued > to reject a Save of a file initially loaded as an import but later > saved with SaveAs. Thanks, James. I tested on Linux including that scenario above where the project was saved from an import then reopened, then the file of same name imported, where the save should be allowed. Also on Windows in Step 4, I emptied the offered file name then selected the same AUP file instead, and another case, emptied the name and typed it in, including typing the name with alternative case. The save was always rejected. So it seems OK to me.
Thanks Gale. Hadn't thought of the (potential) for a case sensitivity issue. If the code had been implemented with string comparisons, that would have been a likely bug.