Commit 65e5e38
committed
fix: convert to BigInt before nanosecond multiplication in all instances
Fixes #3292
Multiple functions compute nanosecond timestamps as
BigInt(milliseconds * 1_000_000). When milliseconds exceed
Number.MAX_SAFE_INTEGER / 1_000_000 (≈ 9.007e9, i.e. any date
after ~1970-04-15), the multiplication overflows IEEE 754 precision
before the BigInt conversion captures it.
Fix all instances (including runEngineHandlers.server.ts:432 which
was missed in the previous PR #3378) by converting to BigInt first:
BigInt(milliseconds) * BigInt(1_000_000)
Made-with: Cursor1 parent 73ea586 commit 65e5e38
3 files changed
Lines changed: 7 additions & 5 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 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
| 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