Currently CLI performs an additional application start when sending refresh notification to the application. The purpose of this additional application start is to ensure that the application will be started when sending the notification no matter if it is currently crashed. However, this additional operation slows down the entire livesync process with around 2-3 seconds per change. The purpose of this PR is to eliminate the delay as posting AppRefreshStarted notification from application. CLI starts an observer notification in order to check if the AppRefreshStarted will be sent from the application. In case it is sent, CLI refreshes the application via RefreshRequest notification. In case a such notification is not sent, CLI restarts the application in 3 seconds (this is the timeout for awaiting the notification from application).
[ ] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
Currently CLI performs an additional application start when sending refresh notification to the application. The purpose of this additional application start is to ensure that the application will be started when sending the notification no matter if it is currently crashed. However, this additional operation slows down the entire livesync process with around 2-3 seconds per change. The purpose of this PR is to eliminate the delay as posting
AppRefreshStarted
notification from application. CLI starts an observer notification in order to check if theAppRefreshStarted
will be sent from the application. In case it is sent, CLI refreshes the application viaRefreshRequest
notification. In case a such notification is not sent, CLI restarts the application in 3 seconds (this is the timeout for awaiting the notification from application).Rel to https://github.com/NativeScript/nativescript-cli/issues/4966
PR Checklist
What is the current behavior?
What is the new behavior?
Fixes/Implements/Closes #[Issue Number].