@@ -666,6 +666,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
666666 filesToSync : currentFilesToSync ,
667667 isReinstalled : appInstalledOnDeviceResult . appInstalled ,
668668 syncAllFiles : liveSyncData . watchAllFiles ,
669+ hmrData : currentHmrData ,
669670 useHotModuleReload : liveSyncData . useHotModuleReload ,
670671 force : liveSyncData . force
671672 } ;
@@ -674,11 +675,13 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
674675
675676 await this . refreshApplication ( projectData , liveSyncResultInfo , deviceBuildInfoDescriptor . debugOptions , deviceBuildInfoDescriptor . outputPath ) ;
676677
677- if ( liveSyncData . useHotModuleReload && currentHmrData . hash ) {
678+ //If didRecover is true, this means we were in ErrorActivity and fallback files were already transfered and app will be restarted.
679+ if ( ! liveSyncResultInfo . didRecover && liveSyncData . useHotModuleReload && currentHmrData . hash ) {
678680 const status = await this . $hmrStatusService . getHmrStatus ( device . deviceInfo . identifier , currentHmrData . hash ) ;
679681 if ( status === HmrConstants . HMR_ERROR_STATUS ) {
680682 settings . filesToSync = currentHmrData . fallbackFiles [ device . deviceInfo . platform ] ;
681683 liveSyncResultInfo = await service . liveSyncWatchAction ( device , settings ) ;
684+ //We want to force a restart of the application.
682685 liveSyncResultInfo . isFullSync = true ;
683686 await this . refreshApplication ( projectData , liveSyncResultInfo , deviceBuildInfoDescriptor . debugOptions , deviceBuildInfoDescriptor . outputPath ) ;
684687 }
0 commit comments