meteor-timesync icon indicating copy to clipboard operation
meteor-timesync copied to clipboard

time-sync server doesn't seem to work Meteor ROOT_URL configuration

Open blongstreth opened this issue 6 years ago • 5 comments

Hello:

I have found that the time-sync server '/_timesync' route doesn't work (route not executed) when the Meteor ROOT_URL environment or configuration variable is specified. As a result, I quickly played around with the handler using __meteor_runtime_config__.ROOT_URL_PATH_PREFIX and that seemed to do the trick. Thus, the handler looked something like this:

const pathPrefix = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX || "";

WebApp.rawConnectHandlers.use(pathPrefix + "/_timesync", function (req, res, next) {    
    // Existing code                       
});

Since I am not using Cordova or anything like that, I didn't account for all the various server configurations (assuming it is required).

Is this something that can be fixed and released soon such that it will work with the user-status package?

Please let me know.

blongstreth avatar May 07 '19 21:05 blongstreth

What version of timesync are you running?

wreiske avatar May 07 '19 21:05 wreiske

I just played around with the latest version 0.5.1.

blongstreth avatar May 07 '19 21:05 blongstreth

Also, please note that I am having to support Meteor version 1.4.3.2 right now. I don't think this makes a difference in this case. Hopefully I can change that soon :-)

blongstreth avatar May 07 '19 21:05 blongstreth

Question please:
If I am using this with the user-status package, what is the worst case scenario with an non-function time sync handler outside of the following issues:

  1. User login timestamp information not synchronized across all browsers.
  2. A bogus API call which returns the entire Meteor application contents instead of a timestamp. Basically, I am wanting to know if you can think of anything really bad or catastrophic please.

blongstreth avatar May 07 '19 21:05 blongstreth

Would you please consider the code snippet I previously provided (or something similar) and create a release soon?

blongstreth avatar Jun 12 '19 06:06 blongstreth

Fix released in v0.5.3

StorytellerCZ avatar Jan 01 '23 02:01 StorytellerCZ