NativeScript / ios-jsc

NativeScript for iOS using JavaScriptCore
http://docs.nativescript.org/runtimes/ios
Apache License 2.0
298 stars 59 forks source link

fix: notify for AppRefreshStarted and remove the log for successful refresh request #1195

Closed Fatme closed 5 years ago

Fatme commented 5 years ago

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).

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].