Skip to content

Vouch Request: BigInt overflow fix (PR #3381) #3385

@aayushbaluni

Description

@aayushbaluni

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

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