Title: Codersdk/ts: migrate workspace ttl to ttl_ms · Issue #1707 · coder/coder · GitHub
Open Graph Title: Codersdk/ts: migrate workspace ttl to ttl_ms · Issue #1707 · coder/coder
X Title: Codersdk/ts: migrate workspace ttl to ttl_ms · Issue #1707 · coder/coder
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 n...
Open Graph 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....
X 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....
Opengraph URL: https://github.com/coder/coder/issues/1707
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Codersdk/ts: migrate workspace ttl to ttl_ms ","articleBody":"TL;DR make all `TTL` references in `codersdk` be milliseconds instead of nanoseconds.\r\n\r\nInitially 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.\r\n\r\nThis 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).\r\n\r\n\r\n```\r\nremark (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.\r\n```\r\n_Originally posted by @johnstcn in https://github.com/coder/coder/pull/1701#discussion_r880316837_","author":{"url":"https://github.com/johnstcn","@type":"Person","name":"johnstcn"},"datePublished":"2022-05-24T14:57:26Z","url":"https://github.com/coder/coder/issues/1707"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:777d23df-22f3-a314-61ea-c434f3f94dac |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84B6:14ECB:1E8D1D3:26C89EF:6B016472 |
| html-safe-nonce | 39ce8aab2beb2f82a6f16c267e6f6c7ae9975390c0a7ae9ff4d40cab7a41eaef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEI2OjE0RUNCOjFFOEQxRDM6MjZDODlFRjo2QjAxNjQ3MiIsInZpc2l0b3JfaWQiOiI5MTM0OTc3NjIxNjczNzMxMTg2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 63e6c16d2a6577a2724d8ab827a9242cf6d7b9ca9adb348a7c2f9ad75d5477bd |
| hovercard-subject-tag | issue:1246690649 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/1707/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3eddcbbc84b60b87a39767d47b333a1f5cdf6427e234324d692895c5159ea70a/coder/coder/issues/1707 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3eddcbbc84b60b87a39767d47b333a1f5cdf6427e234324d692895c5159ea70a/coder/coder/issues/1707 |
| og:image:alt | 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.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | johnstcn |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width