Closed as not planned
Description
TL;DR make all TTL
references in codersdk
be milliseconds instead of nanoseconds.
Initially when defining the external API for workspace time-to-live (TTL), I simply passed through the Golang time.Duration
object as an int64
. This is a nanosecond timestamp, which means that the typescript UI needs to multiply/divide any timestamps by 1 million.
This is a potential source of future time-bugs (the worst kind of bugs), so it would make sense to align the typescript API with what JS/TS generally uses for timestamps (milliseconds).
remark (non-blocking): in a follow-up PR, I think it could make sense to migrate `ttl` to `ttl_ms` in externally-facing API types so that we don't accidentally multiply by a million one way or another. Milliseconds seems to be the accepted unit of time in the TS/JS world.
Originally posted by @johnstcn in #1701 (comment)