Skip to content

Conversation

@jakemac53
Copy link
Contributor

Fixes #302

Previously the behavior was pretty broken, after talking with @jacob314 we decided the best thing to do is actually restart the app (even if it doesn't have anything new to load).

I also did some other cleanup to make things more robust:

  • Handle errors from the $dartHotRestart call and forward them along
  • Return a promise to JS from the $dartHotRestart call so that it can be properly awaited (we weren't actually waiting before because it was a dart future, so this may have contributed to race conditions).
  • Return an actual boolean result (success/failure) for the $dartHotRestart call.

@jakemac53 jakemac53 requested a review from grouma April 19, 2019 21:07
@jakemac53
Copy link
Contributor Author

jakemac53 commented Apr 19, 2019

This might potentially fix #293 as well (if it was due to a race condition)

@jakemac53
Copy link
Contributor Author

@nshahan if you could try and verify that would be great :)

}

/// Returns a Future that resolves once the given [promise] resolves.
/// Returns a [Promise] that resolves once the give [future] resolves.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change give to given

@nshahan
Copy link
Contributor

nshahan commented Apr 19, 2019

@jakemac53 LGTM. It fixes the issue with the app disappearing after manually triggering a hot restart without any changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Triggering a hot restart with no changes causes a blank page

4 participants