Will the app client refresh via hot code push if only server side code was changed?

Hi.

Will the meteor app client refresh via hot code push if only server side code was changed, e.g. something in a method?

Thanks

Yes it will refresh the clients although browsing caching and old tabs my require a hard refresh in some cases. You can test this in development, you will see the tab automatically refresh when the code was changed.

Actually no, if you only change the server-side codes the clients do not reload after the server restarts.

Why does mine do this?

=> Meteor server restarted

I just tested and it did not refresh the client. Looking at the network events it simply switches sockets when the new version with only server side changes is deployed (Meteor Galaxy).

Thanks!

If you want an explanation of how it works look here: https://guide.meteor.com/hot-code-push.html#where-does-it-live and here https://blog.meteor.com/hot-code-push-step-by-step-bd940de7323c.

Basically, each time you deploy a hash of your entire client-side code is calculated. The client only refreshes if the hash is different to the current version.

The bit about Reload._onMigrate() in steps 5/6 of the blog post is interesting - is explains a mechanism whereby you can delay the client reload until the user presses a button - to prevent them losing anything they’re working on in your app, e.g. a half completed form or an open dialog. This provides a really good user experience.

1 Like