The Mail-Funnel builder needs a few pieces of engineering to verify data integrity. There are a few aspects to this.
We need a semaphore lock on the App whenever the data is being modified. This is a simple boolean on the app that is turned on before data is being modified, and off after its modified. The transaction needs to complete so the lock data persists to the server, before the rest of the query continues.
Add a checker that checks the last-modified date on the Apps row to see if the datetime has changed at any time while the App is open. it needs to do an AJAX check against the server every 15-30 seconds to check if the value has changed, and if it has, it needs to notify the user that somebody else is changing values in another funnel-builder instance also open.
Verify Jobs in Postgres Jobs Table correspond 1:1 or 1:many with Jobs in the Redis Queue for the Job Worker. We need to verify the data is is good, and prevent any data from corrupting. Mainly the issue is if we have not enough or too many jobs in the job queue that correspond to the Jobs in the Job table. We need to create a separate job that runs regularly that goes through and checks to see if any jobs in the queue are abandoned and do not correspond to jobs in the job table, as well as add functionality to make sure that this cannot happen in the first place
The Mail-Funnel builder needs a few pieces of engineering to verify data integrity. There are a few aspects to this.