Repository navigation
Commit 3827f4d
committed
fix: use BigInt arithmetic for nanosecond timestamp conversion
Multiplying Date.getTime() by 1_000_000 as a float before converting
to BigInt causes IEEE 754 precision loss once the product exceeds
Number.MAX_SAFE_INTEGER (~9007T, which ms * 1e6 hits around 2255 AD).
The correct pattern already exists in convertDateToNanoseconds():
BigInt(date.getTime()) * BigInt(1_000_000)
Apply it consistently to the three call sites that still use the
float-multiply pattern (getNowInNanoseconds, calculateDurationFromStart,
and the runEngineHandlers retry-event recordEvent call).1 parent 8fcb035 commit 3827f4d
4 files changed
Lines changed: 10 additions & 4 deletions
File tree
- .server-changes
- apps/webapp/app/v3
- eventRepository
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
560 | | - | |
| 560 | + | |
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
| |||
0 commit comments