Commit a125348
committed
fix: convert to BigInt before nanosecond multiplication to avoid precision loss
Multiplying epoch milliseconds by 1,000,000 as a Number exceeds
Number.MAX_SAFE_INTEGER (~9e15), causing IEEE 754 precision loss
of ~256ns in ~0.2% of cases. Convert to BigInt first, then multiply.
Fixed in 4 locations:
- getNowInNanoseconds() in common.server.ts
- calculateDurationFromStart() in common.server.ts
- recordRunDebugLog() in index.server.ts
- retry event recording in runEngineHandlers.server.ts
The correct pattern (BigInt(ms) * BigInt(1_000_000)) already existed
in convertDateToNanoseconds() in the same file.
Closes #32921 parent cf0fdde commit a125348
File tree
3 files changed
+4
-4
lines changed- apps/webapp/app/v3
- eventRepository
3 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
| 431 | + | |
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| |||
0 commit comments