Let restart process continue when reload JS is not possible #602
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes from #477 broke restart flow for the cases when just reloading is not possible.
Previously, when "reload" button was clicked in the UI, we were trying to do the least invasive reload method possible. For that purpose we'd first attempt to reload JS, but only if the app process is alive. Apparently, due to the changes in #477 we were no longer checking whether app is running and we'd always call reload JS and let the restarting process end there.
This turns out to be a problem for example in scenarios where we get bundle error at the app startup. As a consequence, the app process never starts, and it is not possible to reload JS even once the bundle error we're getting gets fixed.
In this PR we're restoring this mechanism:
reloadMetro
method to forward the result fromperform
call which indicates whether the reload was successful.false
we let the restart process continue execution to eventually reach code that tries to restart the app process.Test plan