wojtkowiak / meteor-desktop

Build a Meteor's desktop client with hot code push.
MIT License
448 stars 81 forks source link

desktopHCP module causes app to close and reopen even if .desktop is not updated #102

Open sferoze opened 7 years ago

sferoze commented 7 years ago

If you only change meteor app code (not code in .desktop), and deploy your changes, the desktop app will close and reopen. Even if .desktop has not changed.

Why is this? I expect the app to stay open and just refresh like it typically does in the browser and on cordova devices.

But with the electron app, it closes the whole app and reopens it. And I did NOT change the .desktop folder.

Also sometimes when this happens it crashes the app as well saying the desktop.asar is missing or corrupt. Then if you open the app again, all the CSS is missing and the app is not useable. So you have to reinstall the app again from a brand new build.

I was not able to capture the error message but next time I see the error message I will take screenshot and post it here.

wojtkowiak commented 7 years ago

Are this happening while you develop? I mean, do you have desktop app run from npm run desktop and meteor --mobile-server=127.0.0.1:3000 running?

deploy your changes

What exactly does deploying means for you?

Also sometimes when this happens it crashes the app as well saying the desktop.asar is missing or corrupt.

This seems to be serious. Please if such a thing happens, can you pack you app data dir and attach it here or send it to my email?

The app data dir is named as your app is and is located in: %APPDATA% on Windows $XDG_CONFIG_HOME or ~/.config on Linux ~/Library/Application Support on macOS

sferoze commented 7 years ago

@wojtkowiak

While developing each hot code push does cause the app to close and reopen. But I have not noticed the app crash and become unusable while developing. I just did a test to see how hot reload works with desktopHCP set to false and the app does not close and reopen but it does refresh and show the splashscreen.

I am using this package for hot reloading cordova: https://github.com/jamielob/reloader/

This is an important package for cordova as without it hot code pushes do not work. The same package seems to affect the desktop build too.

The few times I noticed the app crash and becomes unusable is when I was using the production desktop app that I built using the build-installer command.

Once I built the desktop app which is pointed to the production galaxy server, and then deployed an update to galaxy server.

The desktop app was running in the background and when it received the new code bundle it tried to close and reopen but I got this error message saying the desktop.asar is corrupt. (Wish I could have captured the exact message).

If the desktop app is in the foreground while the hot reloading then it seems to work. Hot reloading the desktop app while in the background may cause the issue? Not sure...

In my .desktop/settings I have "window": { "webPreferences": { "backgroundThrottling": false } }

If I notice it happen again, I will post the app data dir here.