Title: OTLP nanosecond timestamp overflow in webapp event repository · Issue #3292 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: OTLP nanosecond timestamp overflow in webapp event repository · Issue #3292 · triggerdotdev/trigger.dev
X Title: OTLP nanosecond timestamp overflow in webapp event repository · Issue #3292 · triggerdotdev/trigger.dev
Description: Several places in the webapp multiply epoch milliseconds by 1,000,000 before converting to BigInt, which causes IEEE 754 precision loss (~256ns errors in ~0.2% of cases). The result exceeds Number.MAX_SAFE_INTEGER (~9e15) since epoch-ms ...
Open Graph Description: Several places in the webapp multiply epoch milliseconds by 1,000,000 before converting to BigInt, which causes IEEE 754 precision loss (~256ns errors in ~0.2% of cases). The result exceeds Number....
X Description: Several places in the webapp multiply epoch milliseconds by 1,000,000 before converting to BigInt, which causes IEEE 754 precision loss (~256ns errors in ~0.2% of cases). The result exceeds Number....
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/issues/3292
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OTLP nanosecond timestamp overflow in webapp event repository","articleBody":"Several places in the webapp multiply epoch milliseconds by 1,000,000 **before** converting to BigInt, which causes IEEE 754 precision loss (~256ns errors in ~0.2% of cases). The result exceeds `Number.MAX_SAFE_INTEGER` (~9e15) since epoch-ms * 1e6 is ~1.7e18.\n\nThe correct pattern is `BigInt(ms) * BigInt(1_000_000)` (multiplication after BigInt conversion). This already exists in `convertDateToNanoseconds()` in the same file - the buggy functions just didn't use it.\n\n**Affected locations:**\n\n1. `apps/webapp/app/v3/eventRepository/common.server.ts:24` - `getNowInNanoseconds()`\n ```typescript\n // Bug: multiplication in float-land\n return BigInt(new Date().getTime() * 1_000_000);\n // Fix:\n return BigInt(new Date().getTime()) * BigInt(1_000_000);\n ```\n\n2. `apps/webapp/app/v3/eventRepository/common.server.ts:38` - `calculateDurationFromStart()`\n ```typescript\n // Bug:\n const duration = Number(BigInt($endtime.getTime() * 1_000_000) - startTime);\n // Fix:\n const duration = Number(BigInt($endtime.getTime()) * BigInt(1_000_000) - startTime);\n ```\n\n3. `apps/webapp/app/v3/eventRepository/index.server.ts:217` - `recordRunDebugLog()`\n4. `apps/webapp/app/v3/runEngineHandlers.server.ts:431` - retry event recording\n\n**Impact:** Low. The errors are +-256 nanoseconds, which is unlikely to cause visible issues. But it's an easy fix and prevents any edge cases with span ordering.\n\n**Context:** Found during compute workload manager PR review (#3114). The supervisor's `msToNano()` was fixed in that PR using a split approach that also preserves sub-ms precision from `performance.now()` arithmetic.\n\nLinear: TRI-8269","author":{"url":"https://github.com/nicktrn","@type":"Person","name":"nicktrn"},"datePublished":"2026-03-29T11:58:47Z","url":"https://github.com/triggerdotdev/trigger.dev/issues/3292"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:836246f4-d9a5-364e-e75d-4de153708a86 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D89A:8BE43:30AC2E4:4529C1E:6AFAE9E5 |
| html-safe-nonce | 6ff586d79e84189d06372aabb63ad130bf44db06311ff0c6527cd29960c65692 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODlBOjhCRTQzOjMwQUMyRTQ6NDUyOUMxRTo2QUZBRTlFNSIsInZpc2l0b3JfaWQiOiIxNTkzODE0MTE1Njc3ODI1NTA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | af2fc2199cc9b8e3887e8689dddc8c6053e77e56fd6c8a396c2adcc5ffcd52ce |
| hovercard-subject-tag | issue:4163979632 |
| 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/triggerdotdev/trigger.dev/3292/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c31f119e92e751e62488322d6b84d8b66d671e50ecc95d81c37c92ba20c04a1/triggerdotdev/trigger.dev/issues/3292 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c31f119e92e751e62488322d6b84d8b66d671e50ecc95d81c37c92ba20c04a1/triggerdotdev/trigger.dev/issues/3292 |
| og:image:alt | Several places in the webapp multiply epoch milliseconds by 1,000,000 before converting to BigInt, which causes IEEE 754 precision loss (~256ns errors in ~0.2% of cases). The result exceeds Number.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nicktrn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913 |
| turbo-cache-control | no-preview |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| 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 | 12fff95459b24b0f882a66698ee6a36a5934d247 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width