Form-builder doesn't show form changes without a page refresh
When adding a form, deleting a form, adding or deleting a field: changes are not shown without a page refresh. After changing the properties of a field, if you then click on another field and then come back to the field you changed, your changes appear to be lost (again, refreshing the page will fix this).
Also, there are subscription errors shown in the browser and the server restarts (yes, it restarts!) on each such change.
What I believe is happening is that because each form is currently stored as a file, rather than in the database, a change to that file triggers nodemon
which assumes that because something has changed it must restart the server. The restart occurs before the subscription is sent out, so the client never gets the news that something has changed.
What I don't understand is how this ever worked -- and it was working a couple of weeks ago.
Basically, it's a really bad idea to be writing files inside the docker container. These form files will not persist if the container is brought down, and will not be shared between servers if multiple servers are running behind a load balancer or fail-over, etc. Customers will frequently lose all changes they've made to forms.
So the appropriate fix is to store forms within the DB instead. This should be done earlier rather than later while customer instances are mostly in the control of our developers, so that customers aren't forced to do migrations and rebuild their forms.
This ticket can replace #217 (closed) and #218 (closed), which described two isolated symptoms of the bigger issue.