Prevent browser reload when updating meteor app

When I deploy a new version of my app, any client that is using it gets a forced reload, this is a problem when users are in the middle of typing or doing something. Is there a way to control when/how this reload happens?

You can try this: https://github.com/meteor/meteor/blob/devel/packages/reload/reload.js#L104-#L129
I’ve not tried yet btw :joy:

There is https://github.com/meteor/mobile-packages/tree/master/packages/mdg:reload-on-resume, but it only seems to work for Cordova applications. Not sure why it is bundled that way, because it looks like the same technique could be used in browsers. Take a peak at https://github.com/meteor/mobile-packages/blob/master/packages/mdg:reload-on-resume/reload-on-resume.js because it could give some clues as to how you could do it.

Wondering if it makes sense to submit a PR to provide this behaviour in the browser.

1 Like

We are using this in our cordova apps but I remember this also working in the web version of our app

Found a fork of reload-on-resume that enables it in the browser… it’s old, but gives some clues: https://github.com/adaptabi/mobile-packages/blob/master/packages/dotnetwise:reload-on-resume/reload-on-resume.js

Found https://atmospherejs.com/aldeed/reload-extras and https://atmospherejs.com/jamielob/reloader that provide a better API and more features.