architect / architect

The simplest, most powerful way to build a functional web app (fwa)
https://arc.codes
Apache License 2.0
2.56k stars 104 forks source link

Sandbox restarts Dynalite on `app.arc` change, losing data #1453

Open andybee opened 1 year ago

andybee commented 1 year ago

Describe the issue If you make a change to app.arc and Sandbox restarts, it restarts Dynalite (without re-running the seed script), so any pre-populated data is lost.

Steps to reproduce Steps to reproduce the behavior:

  1. Setup an Arc project with @tables and a seed script.
  2. Start Sandbox, observe data is populated in Dynalite.
  3. Make a change to app.arc, watch Sandbox restart some processes on the console.
  4. Observe again that no data is now present in @tables.

Expected behavior Either Dynalite isn't restarted if no changes are made to @tables/@tables-indexes/@tables-streams, or if a restart does occur, a seed script (if present) is run again. I understand a slight issue with this is that the seed script is actually a more generic 'Sandbox Startup' script and not specifically for @tables, but hopefully people don't use it for anything that's not idempotent? Or, it's a differently named pragma like @tables-start...?

andybee commented 1 year ago

Just hit this issue again where I've got a plugin that starts/restarts S3rver when Sandbox does it's thing, but because S3rver is losing it's state on a restart and my @sandbox-startup isn't called again, the app fails to read a file it's expecting from the local S3 instance.