Meteor-Community-Packages / meteor-timesync

NTP-style time synchronization between server and client, and facilities to use server time reactively in Meteor applications.
https://packosphere.com/mizzao/timesync
MIT License
118 stars 36 forks source link

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

Closed blongstreth closed 1 year ago

blongstreth commented 5 years ago

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.

wreiske commented 5 years ago

What version of timesync are you running?

blongstreth commented 5 years ago

I just played around with the latest version 0.5.1.

blongstreth commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

StorytellerCZ commented 1 year ago

Fix released in v0.5.3