Repository navigation
OTLP nanosecond timestamp overflow in webapp event repository #3292
Description
Activity
- added a commit that references this issue
on Mar 29, 2026 - added a commit that references this issue
on Apr 12, 2026 - added 2 commits that reference this issue
on Apr 15, 2026 - added a commit that references this issue
on Apr 15, 2026 - added a commit that references this issue
on Jun 17, 2026 - added a commit that references this issue
on Jul 30, 2026 Hi! I've written a fix for this precision loss issue and submitted PR #4499. However, the PR was automatically closed because I am not on the vouched contributors list yet. Could a maintainer please vouch for me so I can reopen the PR? Thank you!
Hi — noticed this is still open and the buggy
BigInt(ms * 1e6)pattern is still on main ineventRepository/common.server.ts. Prior spam PRs were closed; no open claim.Happy to ship a clean TS fix: switch all ms→ns sites to
BigInt(ms) * BigInt(1_000_000)(matchingconvertDateToNanoseconds), plus a small regression test.If useful, could you
/bounty $125on this issue via Algora? I’ll exclusive-PR within 48–72h as@robinthedev-a11y.Happy to adjust amount/scope. Thanks for the OSS + past Algora payouts.
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.The correct pattern is
BigInt(ms) * BigInt(1_000_000)(multiplication after BigInt conversion). This already exists inconvertDateToNanoseconds()in the same file - the buggy functions just didn't use it.Affected locations:
apps/webapp/app/v3/eventRepository/common.server.ts:24-getNowInNanoseconds()apps/webapp/app/v3/eventRepository/common.server.ts:38-calculateDurationFromStart()apps/webapp/app/v3/eventRepository/index.server.ts:217-recordRunDebugLog()apps/webapp/app/v3/runEngineHandlers.server.ts:431- retry event recordingImpact: 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.
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 fromperformance.now()arithmetic.Linear: TRI-8269