You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When timestamps are added using PipeRegistry.add_timestamps (source) current time is NOT converted to UTC.
Command::Timestamps (source), on the other hand, converts the current time to UTC.
This leads to a situation in certain scenarios (for example, when Postgres is the database adapter - Sequel's DateTime type is mapped to Postgres' timestamp without time zone, hence the timezone offset is not being parsed) where equal timestamps differ since one of the timestamps gets converted to UTC beforehand.
I think that both APIs should at least have the same behavior, as in either they both convert to UTC before persisting the timestamps, or both preserve the application timezone.
Describe the bug
When timestamps are added using
PipeRegistry.add_timestamps
(source) current time is NOT converted to UTC.Command::Timestamps
(source), on the other hand, converts the current time to UTC.This leads to a situation in certain scenarios (for example, when Postgres is the database adapter - Sequel's
DateTime
type is mapped to Postgres'timestamp without time zone
, hence the timezone offset is not being parsed) where equal timestamps differ since one of the timestamps gets converted to UTC beforehand.I think that both APIs should at least have the same behavior, as in either they both convert to UTC before persisting the timestamps, or both preserve the application timezone.
To Reproduce
Expected behavior
created_at_from_command
andcreated_at_from_changeset
should be approximately the same, not have a 3-hour difference.My environment
rom-5.2.6
rom-changeset-5.2.3
rom-core-5.2.6
rom-repository-5.2.2
rom-sql-3.5.0
This is possible to avoid by replacing
.map(:add_timestamps)
with.map { |tuple| tuple.merge(created_at: Time.now.utc) }
as a temporary workaround.Should I submit a PR?
The text was updated successfully, but these errors were encountered: