Skip to content

Deprecate Sequent.configuration.time_precision in favour of ActiveSupport's - #560

Closed
erikrozendaal wants to merge 1 commit into
masterfrom
improvement/deprecate-time-precision
Closed

erikrozendaal wants to merge 1 commit into
masterfrom
improvement/deprecate-time-precision

Conversation

@erikrozendaal

Copy link
Copy Markdown
Member

Sequent's time_precision looked like it set the precision of times, but the JSON of events and commands always uses ActiveSupport::JSON::Encoding.time_precision, which Oj follows in rails mode. Sequent's setting was a copy of ActiveSupport's precision taken when Sequent was loaded, so setting it, or changing ActiveSupport's precision afterwards, made code that relied on it, like ParamSupport, disagree with the stored JSON.

Reading the setting now returns ActiveSupport's precision and setting it has no effect, both with a deprecation warning, so there is one precision that matters. Setting it deliberately does not change ActiveSupport's precision, since that would change the JSON of the whole application, including newly stored events.

…port's

The precision of the times in the JSON of events and commands is that of
ActiveSupport::JSON::Encoding.time_precision, which Oj follows in rails
mode. Sequent's time_precision was a copy of it taken when Sequent was
loaded, which only ParamSupport used, so setting it, or changing
ActiveSupport's precision later, made the two differ. Reading it now
returns ActiveSupport's precision, and setting it has no effect, both
with a deprecation warning.
@erikrozendaal

Copy link
Copy Markdown
Member Author

Replaced by #562: time_precision stays, and reads ActiveSupport's current value when it is not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant