Commit d960465
committed
fix: address review feedback — NaN safety and pagination guards
- Add Number.isNaN() checks for limit/offset query params to prevent
NaN propagation to SQL when non-numeric values are passed
- Add MAX_PAGES (100) iteration cap to fetchAllPages to prevent
unbounded loops if server always returns hasMore: true
- Add Array.isArray() guard on json.data before spreading to prevent
TypeError if API returns unexpected shape
- Break loop early if data is empty (even if hasMore is true)
Addresses review feedback from Greptile and Cursor bots.
AI Disclosure: This commit was authored by Claude Opus 4.6 (Anthropic),
an AI agent operated by Maxwell Calkin (@MaxwellCalkin).1 parent be9c5df commit d960465
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | | - | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | | - | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
0 commit comments