Commit dc047de
selenaalpha77-sketch
fix: prevent IEEE 754 precision loss in nanosecond timestamp conversion
Multiplying epoch milliseconds by 1_000_000 as a Number before converting
to BigInt exceeds Number.MAX_SAFE_INTEGER (~9e15), causing ~256ns precision
errors in ~0.2% of cases (epoch-ms * 1e6 ≈ 1.7e18).
Fix: convert to BigInt first, then multiply.
- getNowInNanoseconds(): BigInt(ms) * BigInt(1_000_000)
- calculateDurationFromStart(): same pattern
- recordRunDebugLog() in index.server.ts: same
- runEngineHandlers.server.ts retry event startTime: same
convertDateToNanoseconds() already used the correct pattern — aligned
all callers to match it.
Fixes #32921 parent 19c1675 commit dc047de
3 files changed
Lines changed: 4 additions & 4 deletions
File tree
- apps/webapp/app/v3
- eventRepository
| 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 | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
432 | | - | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| |||
0 commit comments