Skip to content

fix: apply changes correctly when app is uninstalled from device during the execution of tns run android --hmr command #4006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Oct 10, 2018

In case when tns run android --hmr command is executed and the app is uninstalled from device during the execution of command, {N} CLI installs the application again on device but the changes are not applied. When a change occurs during the execution of command, {N} CLI sends only .hot-update files on device. (without bundle.js and vendor.js). But in this specific case {N} CLI should send all files on device including bundle.js and/or vendor.js.

PR Checklist

Steps to reproduce:;

  1. run android --hmr

  2. make changes – applied

  3. Uninstall app without stop the proccess

  4. Make new changes and save

  5. The app will install without new changes

…ring the execution of `tns run android --hmr` command
@@ -649,6 +649,11 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
skipModulesNativeCheck: !liveSyncData.watchAllFiles
}, { skipNativePrepare: deviceBuildInfoDescriptor.skipNativePrepare });

if (liveSyncData.useHotModuleReload && appInstalledOnDeviceResult.appInstalled) {
const additionalFilesToSync = currentHmrData && currentHmrData.fallbackFiles && currentHmrData.fallbackFiles[device.deviceInfo.platform];
_.each(additionalFilesToSync, fileToSync => currentFilesToSync.push(fileToSync));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer this:

const additionalFilesToSync = currentHmrData && currentHmrData.fallbackFiles && currentHmrData.fallbackFiles[device.deviceInfo.platform] || [];
fileToSync.push(...additionalFilesToSync);

But it is just personal preference. Not a blocker.

@DimitarTachev DimitarTachev merged commit 33fdfe2 into master Oct 10, 2018
@DimitarTachev DimitarTachev deleted the fatme/fix-reinstalled-hmr branch October 10, 2018 15:50
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.

3 participants