[flutter_tools] force page refresh when hot restarting in profile/release mode (#50215)

This commit is contained in:
Jonah Williams
2020-02-05 17:43:05 -08:00
committed by GitHub
parent e300c1a45a
commit 91c342e213
2 changed files with 52 additions and 3 deletions

View File

@@ -453,8 +453,12 @@ class _ExperimentalResidentWebRunner extends ResidentWebRunner {
.join(',');
try {
if (fullRestart) {
await _wipConnection?.sendCommand('Page.reload');
if (fullRestart || !debuggingOptions.buildInfo.isDebug) {
// On non-debug builds, a hard refresh is required to ensure the
// up to date sources are loaded.
await _wipConnection?.sendCommand('Page.reload', <String, Object>{
'ignoreCache': !debuggingOptions.buildInfo.isDebug,
});
} else {
await _wipConnection?.debugger
?.sendCommand('Runtime.evaluate', params: <String, Object>{
@@ -808,10 +812,15 @@ class _DwdsResidentWebRunner extends ResidentWebRunner {
return chromeTab.url.contains(debuggingOptions.hostname);
});
final WipConnection wipConnection = await chromeTab.connect();
await wipConnection.sendCommand('Page.reload');
// On non-debug builds, a hard refresh is required to ensure the
// up to date sources are loaded.
await wipConnection?.sendCommand('Page.reload', <String, Object>{
'ignoreCache': !debuggingOptions.buildInfo.isDebug,
});
status.stop();
return OperationResult.ok;
} catch (err) {
globals.printTrace(err.toString());
// Ignore error and continue with posted message;
}
}