-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Match timezones #34
base: master
Are you sure you want to change the base?
Match timezones #34
Conversation
@celsodantas Hey there, here's the fix for issue: #33 |
@celsodantas we were finally able to figure out the reason for the duplicate ID's, the fix is included with this PR. |
Hey guys! Thanks so much for hunting down this bug, but I think the fix needs to be somewhere else. https://github.com/celsodantas/protokoll/blob/master/lib/protokoll/formater.rb#L64-L69 << all the plus, this: should be comparing
The issue I see using The issue with my suggestion is that it's a breaking fix (will need to bump the major) and will format all the numbers using UTC. So maybe we should have an extra option to be passed to the What do you guys think? |
@celsodantas you do raise good points with your suggestions regarding patching the However, even if servers are distributed across different timezones, in a Rails application
And this above setting then becomes Now, if we started generating these sequences based on UTC timezone as you proposed, the users may start seeing records that they don't expect. Ex: a record created on 8th August, 10pm EDT/EST, will trigger the date to be 9th of August in UTC: causing a bit of a confusion for the users (given they know the pattern behind the sequence generation) Perhaps, the solution can be to make
What are your thoughts on this? cc @manpreetnarang |
Oh wait, did I just said the same thing that you were proposing? 😄 |
hehe yeah, you did. 😂 You are right about the timezone used by the Rails server. But We could do your way, by passing a lambda (lambda is just cleaner =D):
I like it. IMO, the Do you guys want to implement it? If not, I can do it. |
@celsodantas thanks for getting back, I like the
Would appreciate if you can implement this, and we can chime in to help with manual verification/testing/QA on this. |
@@ -30,7 +29,7 @@ def self.build_attrs(object, options) | |||
end | |||
|
|||
def self.outdated?(record, options) | |||
Time.now.utc.strftime(update_event(options)).to_i > record.updated_at.strftime(update_event(options)).to_i | |||
Time.zone.now.strftime(update_event(options)).to_i > record.updated_at.strftime(update_event(options)).to_i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time.zone.now.strftime(update_event(options)).to_i > record.updated_at.strftime(update_event(options)).to_i | |
Time.current.strftime(update_event(options)).to_i > record.updated_at.strftime(update_event(options)).to_i |
No description provided.