trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

Vouch Request: BigInt overflow fix (PR #3381)

Open aayushbaluni opened this issue 7 months ago • 1 comments

What I want to work on

I've submitted PR #3381 which fixes IEEE 754 precision loss in nanosecond timestamp calculations across three files:

  • apps/webapp/app/v3/eventRepository/common.server.ts
  • apps/webapp/app/v3/eventRepository/index.server.ts
  • apps/webapp/app/v3/runEngineHandlers.server.ts

The bug: BigInt(milliseconds * 1_000_000) overflows before BigInt conversion because Date.now() * 1_000_000 exceeds Number.MAX_SAFE_INTEGER. The fix converts to BigInt first: BigInt(milliseconds) * BigInt(1_000_000).

This is a resubmission of #3378 which was closed because it missed one instance. PR #3381 fixes ALL instances.

Background

I'm an open source contributor with PRs in multiple repos including Flowise, Haystack, Reth, supabase-js, and graph-node. I have experience with TypeScript/Node.js and am familiar with the trigger.dev codebase through investigating this bug.

Links

  • Issue: #3292
  • PR: #3381 (auto-closed, pending vouch)
  • Previous PR: #3378 (closed, missed one instance)

aayushbaluni avatar Apr 15 '26 12:04 aayushbaluni

We have a new Vouch policy, please see the discussion here: https://github.com/triggerdotdev/trigger.dev/discussions/5010

matt-aitken avatar Oct 07 '26 15:10 matt-aitken