RocketChat / Rocket.Chat.Cordova

Rocket.Chat Cross-Platform Mobile Application via Cordova (DEPRECATED)
MIT License
104 stars 109 forks source link

__meteor_runtime_config__.ROOT_URL not changed when ROOT_URL is changed #59

Closed Sing-Li closed 8 years ago

Sing-Li commented 8 years ago

For some reason __meteor_runtime_config__.ROOT_URL value in https://rocketchat-host/__cordova/index.html is not changed even when the ROOT_URL value is changed via the admin console, or via our __Auto ROOT_URL detect popup toast__.

This will cause the mobile app to load the previous ROOT_URL value, resulting in a blank (or white bar) login screen.

This happens frequently because the default is localhost:3000 - and many rely on our 'auto detect toast' to fix the ROOT_URL for all non-mobile clients.

Highly likely the cause of #25

Johann-Snapp commented 8 years ago

Tested on Android, debugging with chrome.

On the server screen:

After downloading files from the server:

The application fails to downoad sandstorm-credentials. As the file is not found, the xhr response body is null and the callback throws: "/.sandstorm-credentials is not JSON?". When I look at the request headers, I've got something illogic in the Request URL field. It looks like => http://httpmyip3000.meteor.local/.sandstorm-credentials. ie if my ip is 1.1.1.1, I've got: http://http11113000.meteor.local/.sandstorm-credentials. I've tried to change "meteor.local" into "myip:300" everywhere in the project to check if it would work but without success.

EDIT: If I change my IP for a domain name, I don't have the .sandstorm-credentials problem anymore but it still doesn't work. I've tried to switch from port 3000 to 80, it doesn't change anything.

EDIT2: Note that the problem occurs only while trying to connect to a dev instance. If I try to connect to demo.rocket.chat or to an instance installed on a server, there's no problem at all.

EDIT3: When I try to connect through an emulator, it works well too. So the problem only occurs while trying to connect to my development server from a real device.