mrauhu / meteor-clusterws

Guide for adding support of 🚀 ClusterWS in the Meteor
7 stars 0 forks source link

Question: How to switch to meteor-uwebsockets smoothly (in a Cordova App)? #2

Closed DanielDornhardt closed 3 years ago

DanielDornhardt commented 4 years ago

Hi, while testing the meteor-uwebsockets implementation I ran into the following issue (I think):

When I updated the server version, desktop-clients would work fine after a reload (or maybe even did the hot code push update alright, I'm not totally sure).

But my cordova-app, which was built containing the previous version of my app, wouldn't connect to the updated server to download the new client it seems?

I got some messages on the cordova apps' console about CORS / Invalid access / headers to the local server (which runs within the cordova app to server the actual files of the app to the cordova webview).

Now when I rebuilt the entire app with the new source code included everything seems to work fine.

But of course the issue is, when I want to update to the new code, my existing customers won't be update via HCP, and even if I go the "long way" through the app store it's not clear when everyone will have updated, and that means that some customers might look at an app which is stuck at the loading screen, which isn't good.


Do you have any Idea how I could mitigate this maybe? Is it possible to first deploy only the client part, without updating the server for example? Then I could monitor the installed apps "in the wild" and update them in a two-step process.

Thank you again for your effort.

mrauhu commented 4 years ago

Hello, @DanielDornhardt.

Do you have any Idea how I could mitigate this maybe?

You can use a proxy-server (like Nginx) and two Meteor servers (one with stream-server-uws, other is SockJS).

                     location /
Cordova app -> Nginx -----------> Meteor with `stream-server-uws`
                 |
                 | location /sockjs
                 v
               Meteor with `stream-server`

If you need help with implementation you can email me.

Best wishes, Sergey.