Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1859 - Macros on files - Save Project causes overwrites. thus loses data
Macros on files - Save Project causes overwrites. thus loses data
Status: RESOLVED QUICKFIXED
Product: Audacity
Classification: Unclassified
Component: User Interface
2.3.0
Per OS All
: P1 RepeatableAll
Assigned To: James Crook
: test_single_OS
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-27 05:23 UTC by Peter Sampson
Modified: 2018-08-20 11:46 UTC (History)
5 users (show)

See Also:
Steps To Reproduce:
1) create a folder with three WAV files 2) Create a new Macro with just the "Save Project" command 3) Run that Macro on the three WAV files 4) Observe that on the first pass, the batch process is interrupted for user input for a file location. 5) Observe further that on the second and third pass, the Macro overwrites the existing project from step 4 6) Result: just one project not three and the first two projects are overwritten/lost with no user warning issued.
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
petersampsonaudacity: Test‑OK‑Win+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sampson 2018-03-27 05:23:30 UTC
Using "Save Project" in a Macro when applied to files causes overwriting of the projects as it progresses with the final result is that there is just one project and that is the last file processed.

Basically the Save should be working in a similar manner to the "Export as MP3" in the supplied "MP3 Conversion" Macro - where the .mp3 file is constructed from the file name.  

Also there should be no user intervention needed as at step 4 to prompt for a project file location - Apply macro to Files is intended to be a batch process to be run in the background without user intervention (except in the case of error, e.g. potential overwrites).
Comment 1 Peter Sampson 2018-03-27 05:27:46 UTC
See also Bug #1856  Applying Macros to Files is no longer a batch process
Comment 2 Peter Sampson 2018-06-07 08:06:59 UTC
I am upgrading this to P1 - as we are rapidly approaching the scheduled release date for 2.3.0 ab we really should not be releasing functionality that can cause data loss.
Comment 3 James Crook 2018-08-05 16:42:16 UTC
DEVEL - FIX MADE
https://github.com/audacity/audacity/commit/9357c90b43fe9e29127e75e94b512ad03987336a

This was a quite invasive fix, and needs careful testing on one platform.  Things that could go wrong include history mechanism, edits on a project after using Macros and 'Save' when the .aup file already exists.  In debugging I caught and fixed a number of such issues, including ones involving orphan block files.  Save in a Macro and outside a Macro now behave slightly differently.
Comment 4 Peter Sampson 2018-08-06 06:14:07 UTC
Testing on W10 with audacity-2.3.0-alpha-70

As far as I can tell, this now seems to be working properly, with three projects properly created and no overwriting or project loss.

I did get the warning advising that it's best to copy in the dependent files - but once that was acknowledged with an "always do ..." I did not get the Macro batch process interrupted again.


But when I run the Steps to reproduce a second time to attempt overwriting the existing projects I get an error blocking me from overwriting the project.

But note that now in 2.3.0 we now allow project overwriting with a warning - so for consistency we should allow it in macros too.  In normal project saves there is no ability to hide the warning on future saves (for safety reasons) - but in Macros maybe we should allow the user to select a "do this throughout this Macro".


You (James, as doer-decides) may of course decide, declare, that no overwrite in Macros is designed  intended behavior - in which case I would pass this as OK
Comment 5 James Crook 2018-08-06 07:10:29 UTC
I think overwriting a .aup from within a macro without prompting is too dangerous, so I am minded not to allow it.  I really WOULD want to prompt for every file, so it would interrupt a script were overwrite allowed.

Someone disappointed by the behaviour could already move their existing .aup files out the way before running the macro.  I do not think they are materially inconvenienced.  So as doer-decides I think the current no overwriting behaviour is OK, and actually a good thing.