-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Don't reset history on hot restart #27872
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
MultiEntriesBrowserHistory(urlStrategy: _customUrlStrategy); | ||
_browserHistory = _createDefaultBrowserHistory(_customUrlStrategy); | ||
} | ||
registerHotRestartListener(() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the hot restart teardown the history entries? If it does, we will lose all the url and state even if we memorize the mode. If it does not, I think we can just read the current state to determine whether that is a multi entry or single entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a test, the change lgtm
I'm relying on existing tests to catch any regression caused by this PR. I also filed an issue to add an integration test. I need to figure out how to test hot restart on web. |
sounds good, I think we can write a simple test for createHistoryForExistingState before we have integration test coverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
) * 'Update Dart SDK to aa7d19d' * [web] Don't reset history on hot restart (#27872) * Makes scrollable to use main screen if the flutter view is not attached to a screen (#28110) * Fix regression in system UI colors (#28206) * update licenses golden Co-authored-by: Mouad Debbar <[email protected]> Co-authored-by: chunhtai <[email protected]> Co-authored-by: Kate Lovett <[email protected]>
…tter#28415) * 'Update Dart SDK to aa7d19d' * [web] Don't reset history on hot restart (flutter#27872) * Makes scrollable to use main screen if the flutter view is not attached to a screen (flutter#28110) * Fix regression in system UI colors (flutter#28206) * update licenses golden Co-authored-by: Mouad Debbar <[email protected]> Co-authored-by: chunhtai <[email protected]> Co-authored-by: Kate Lovett <[email protected]>
When hot restart happens, instead of resetting browser history, we just remember which history mode was being used. Once the app starts again after the hot restart, we re-create the same history mode. Then:
Fixes flutter/flutter#79241