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
I'd like to fix issue #3292 (OTLP nanosecond timestamp overflow in the webapp event repository).
The bug: several places in the webapp multiply epoch milliseconds by 1_000_000 before converting to BigInt, which loses IEEE 754 precision (epoch-ns values are ~1.7e18, well past Number.MAX_SAFE_INTEGER), producing small errors in span timestamps. The affected functions are getNowInNanoseconds() and calculateDurationFromStart() in app/v3/eventRepository/common.server.ts, recordRunDebugLog() in app/v3/eventRepository/index.server.ts, and the retry event recording in app/v3/runEngineHandlers.server.ts.
I've already implemented the fix on a branch: all four sites now convert to BigInt before multiplying (BigInt(ms) * BigInt(1_000_000)), plus a colocated regression test (common.server.test.ts) that fails on the current code and passes with the fix — vitest shows 2 of 3 tests failing pre-fix (with a +64ns error at the exact-instant boundary) and 3/3 passing post-fix, and the webapp typecheck is clean. The branch is ready on my fork (QQSHI13/trigger.dev, branch fix/otlp-nanosecond-overflow) and I'll open the PR as soon as I'm vouched.
Prior contributions or relevant experience
TypeScript/Node.js work, including precision-sensitive data-pipeline code. Happy to iterate through review rounds.
Activity
matt-aitken commentedon Oct 7, 2026
We have a new Vouch policy, please see the discussion here: #5010