Skip to content

Vouch Request: QQSHI13 — fix for #3292 (OTLP nanosecond timestamp overflow) #4927

Description

@QQSHI13

Why do you want to contribute?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions