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

guess new server offset #46

Closed maxnowack closed 7 years ago

maxnowack commented 7 years ago

If the client time has changed, but the server is unreachable, serverTime is undefined. Normally this case occurs if the computer wake up from hibernation and have no network connection. This change tries to guess the new offset. Guessing the offset only works if the server time hasn't changed (I think, in the most cases it’s UTC and it doesn’t change).

mizzao commented 7 years ago

Hi @maxnowack, I've been rather busy lately, so I gave you commit access to merge this and make any changes you'd like. Thanks for following the code style and updating the tests.

If you give me your Meteor developer username, I can give you permission to publish new versions of the package as well. It would be really nice if you did that, as it would fix the strange issue raised in #42. :)

maxnowack commented 7 years ago

Hey @mizzao, sounds good. My meteor username is also maxnowack

mizzao commented 7 years ago

Great, you can now publish new versions of the package. I usually use the following simple procedure for publishing, although you can do what works for you:

If publishing didn't work, you can fix things, amend the commit as necessary, then tag and push after verifying that it went through.

Thanks so much for your help!