Page 1 of 1

cloud timestamps

Posted: Thu Aug 08, 2019 10:57 am
by krolldk
Hi

I'm reading the php for the cloud save solution: Am I correct in assuming that the timestamp is generated clientside ?
This is potentially problematic, if true.

Assume two users are in different timezones, and accessing the same file, at about the same time. user1, in NY will timestamp with NY time, while user2 in copenhagen will timestamp with copenhagen time. the timestamps will be useless, and if you use them for checking file integrity or something like that, they will be error prone.

suggestion: Set and check timestamps in php directly: In that way, you will get SERVER time on the timestamps, and timestamps will be internally consistent.

Unless I'm missing something ? I'm not trying to be a dick here: I really like easySave, and would love to keep using it, I just want the kinks to be sorted out :-)

Re: cloud timestamps

Posted: Thu Aug 08, 2019 8:25 pm
by Joel
Hi there,

The timestamps are generated clientside, but they're always generated as UTC timestamps (i.e. UNIX timestamps), so they're unaffected by the client's timezone.

We don't generate these on the server as these need to be compared with the timestamp of the locally-stored file on the client's computer (which is converted to UTC before comparison), so it wouldn't be possible to do this serverside. Hope this helps clear things up.
I'm not trying to be a dick here: I really like easySave, and would love to keep using it, I just want the kinks to be sorted out :-)
Really gratefully for your help, you definitely don't come across as a dick, and I certainly hope I don't come across as one either :lol:

All the best,
Joel

Re: cloud timestamps

Posted: Fri Aug 09, 2019 10:16 am
by krolldk
Ah .. I see. UTC timestamps actually makes a lot of sense. I hadn't twigged that.
So.. we shouldn't worry about timezone issues, but still of course badly set client clocks could be a problem in race conditions.
But, there you go. I get the reason you're doing it client side now, and I get why it works.

And no: You don't come across as a dick at all :-) On the contrary, I think you're responding profesionally and patiently.