Skip to content

fix: integer arithmetic for timestamps, emit elapsed_since_start_ns as string#28

Merged
JonasBa merged 1 commit intomainfrom
fix/timestamp-precision
Apr 30, 2026
Merged

fix: integer arithmetic for timestamps, emit elapsed_since_start_ns as string#28
JonasBa merged 1 commit intomainfrom
fix/timestamp-precision

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Apr 30, 2026

Fix integer arithmetic and align ts type

…d_since_start_ns as string

- Replace `* 1e3` with `* 1000` and `* 1e-3` with `/ 1000` for
  microsecond-to-nanosecond and microsecond-to-millisecond conversions.
  The floating-point literals promoted uint64_t to double and back,
  which is unnecessary for integer-to-integer conversion.
- Emit elapsed_since_start_ns as a string via napi_create_string_utf8
  instead of napi_create_int64. The TypeScript type declares this field
  as string, and nanosecond values can exceed Number.MAX_SAFE_INTEGER
  for long profiles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JonasBa JonasBa merged commit e18a721 into main Apr 30, 2026
66 checks passed
mydea added a commit to getsentry/sentry-javascript that referenced this pull request May 8, 2026
…4.0 (#20720)

Bumps this from 2.2.0 to 2.4.0, including the following changes:

## v2.4.0

* feat: Add Node 26 support
(getsentry/sentry-javascript-profiling-node-binaries#32)

## v2.3.0

* fix: Memory leaks, integer truncation, UB, and double-stop
(getsentry/sentry-javascript-profiling-node-binaries#26)
* fix: Integer arithmetic for timestamps, emit elapsed_since_start_ns as
string
(getsentry/sentry-javascript-profiling-node-binaries#28)
* fix: Dead member, capacity checks, insert perf, napi_env by value
(getsentry/sentry-javascript-profiling-node-binaries#27)
* chore: Replace execSync with execFileSync to prevent command injection
(getsentry/sentry-javascript-profiling-node-binaries#23)
* chore: Pin GitHub Actions to full-length commit SHAs
(getsentry/sentry-javascript-profiling-node-binaries#24)
* ci: Build Linux in container for wider glibc support
(getsentry/sentry-javascript-profiling-node-binaries#16)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants