Skip to content

Codersdk/ts: migrate workspace ttl to ttl_ms #1707

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

Closed
johnstcn opened this issue May 24, 2022 · 2 comments
Closed

Codersdk/ts: migrate workspace ttl to ttl_ms #1707

johnstcn opened this issue May 24, 2022 · 2 comments
Labels
api Area: HTTP API stale This issue is like stale bread.

Comments

@johnstcn
Copy link
Member

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)

@kylecarbs kylecarbs changed the title refactor: codersdk/ts: migrate workspace ttl to ttl_ms Codersdk/ts: migrate workspace ttl to ttl_ms Jun 7, 2022
@kylecarbs kylecarbs added the chore label Jun 7, 2022
@github-actions
Copy link

github-actions bot commented Aug 7, 2022

This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Aug 7, 2022
@johnstcn johnstcn reopened this Aug 15, 2022
@johnstcn johnstcn removed the stale This issue is like stale bread. label Aug 15, 2022
@bpmct bpmct added the debt label Sep 21, 2022
@github-actions
Copy link

This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Nov 21, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API stale This issue is like stale bread.
Projects
None yet
Development

No branches or pull requests

3 participants