surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.16k stars 399 forks source link

Rename user preset appears database lock error #6959

Closed ghost closed 1 year ago

ghost commented 1 year ago
  1. Rename a user preset and save
  2. The error appears: PatchDB - Loading Favorites SQL Error[5]. Database is locked (This Error appears two times immediataly)
  3. After confirm, the preset is finally renamed
  4. If i want to perform now the following i got the same error: PatchDB - SQL Error[5]. Database is locked (without the "Loading Favorites"), and this time up to 20+ times immediataly, that i have to confirm now
    • save a new preset, delete a preset, favorite a preset
    • again after confirming all the errors, the action was performed, and i see the favorite, the preset is deleted or a new is created!
    • Refresh patch browser doesn't help
    • Restart the surge standalone session or the DAW host helps and all actions can performed without an error as long as no preset rename is performed! Then the error appears again for all the actions above!
baconpaul commented 1 year ago

I was able to reproduce this on ubuntu with the standalone.

baconpaul commented 1 year ago

Ahh the problem is that rename == save then delete the save happens and rebuilds the database so then the delete happens and also rebuilds the database so we have dueling rebuilds

annoying. need to ponder.

mkruselj commented 1 year ago

Can we not save then delete and only then update database? If needed thread a parameter to save function to skip database rebuild, defaulted to true?

baconpaul commented 1 year ago

Yes but I think that’s not it anyway

also that’s an annoying code change for an annoying reason

baconpaul commented 1 year ago

OK I've found it. It was slightly different than I thought

basically a threading error. A couple of defensive fixes coming in next 30 minutes.

baconpaul commented 1 year ago

OK all merged.