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
Taking raw integers has led to clients passing invalid values in past
releases (milliseconds or microseconds). This is, however, quite
damaging as it means there are *three* possible representations of the
same config, depending on which of s/ms/us gets stored, and while we
have patched around those issues, there is still a type safety concern
as it could happen again.
This fixes it so that we *always* store timestamps as
std::chrono::sys_seconds making it completely unambiguous what it holds,
and ensuring that the proper values gets passed in (either through
direct construction, or by calling session::to_sys_seconds to explicitly
guess based on the magnitude).
This should keep any milliseconds or microseconds usage strictly within
the API and make it very difficult for such an erroneous value to end up
inside the actual serialized config.
This also updates volatile last_read in a similar way: but since that
one is always unix epoch milliseconds, using a
std::chrono::sys_time<std::chrono::milliseconds> (typedefed to
session::sys_milliseconds) for the type safety. Unlike the above, this
one has never had ambiguous values and so doesn't need the same
heuristics. Making it typesafe makes it stay that way.
0 commit comments