I have an entityManager containing entities with entityStatus: "Added". When website is offline I want to add new entities and export them to the LocalStorage. When the website goes online again I need to import entities back to a manager and send them to server DB.
I've got this working except one thing: If I have several browser windows open in offline mode breeze trying to send data from all the pages. And when internet connection appears all scripts in open browser windows send the same data at the same time. Thus I have several records in my database that are the same.
UPDATE: deleting saved entry in local storage is not the best solution because sending could fail and I will lose data. Deleting local storage entry in a send callback doesn't solve the problem as well because at that time all open windows would be already fed with data from local storage and will send duplicates to DB
What is the strategy to avoid multiple saving from several pages?