Context
When we exit the app we need to stop the sync engine from watching the folder and we need to unregister the sync provider. Both of those tasks are done in the sync engine background process so we need to await a message from that process to know that it has been done.
Problem
When the setup of the syn engine fails we cannot add the handler to stop the engine so when the main process tries to close it, it awaits a promise that will never be fulfilled.
Proposed solution
Communicate to the main process whether the setup of the sync engine has been successful or not to await the stop message when it has been successful.
Also changed the import of virtual drive dependency to a require so it can be part of the setup function since the build of node-win can be finicky
Context When we exit the app we need to stop the sync engine from watching the folder and we need to unregister the sync provider. Both of those tasks are done in the sync engine background process so we need to await a message from that process to know that it has been done.
Problem When the setup of the syn engine fails we cannot add the handler to stop the engine so when the main process tries to close it, it awaits a promise that will never be fulfilled.
Proposed solution Communicate to the main process whether the setup of the sync engine has been successful or not to await the stop message when it has been successful.
Also changed the import of virtual drive dependency to a
require
so it can be part of the setup function since the build of node-win can be finicky