renyuneyun / Easer

User-defined explicit automation for Android
https://renyuneyun.github.io/Easer/
GNU General Public License v3.0
805 stars 92 forks source link

Saving an edited script keeps old script as a copy #447

Open Redsandro opened 2 years ago

Redsandro commented 2 years ago

Describe the bug

When editing and saving a script, the old version remains active until the phone is rebooted. The old version is nowhere to be seen, but it still triggers. This may be the reason for multiple bug reports dating as far back as 2018 when people ask "why is my script triggered so many times".

You can see this in the Activity History when hitting the refresh button on the Outline page.

To Reproduce

  1. Have clean install
  2. Create single script from condition
  3. Hit refresh on the Outline page
  4. Observe there is only one entry on the Activity History page
  5. Clean the Activity History
  6. Edit the script a bunch of times: Toggle volatile/persistence, save, toggle Reoccurring, save, rename, save, toggle things back, save
  7. Hit refresh on the Outline page
  8. Observe there is a whole bunch of entries on the Activity History page
  9. Clean the Activity History
  10. Reboot phone
  11. Hit refresh on the Outline page
  12. Observe there is now one single entry on the Activity History page again.

Expected behavior

Editing and saving a script removes the old script from being triggered

Extra phone info: