#11178: fix: use Number.parseInt with explicit radix in parseDateToMs
gateway
stale
Cluster:
Messaging Platform Improvements
## Summary
- `parseDateToMs` in `usage.ts` uses bare `parseInt(year)` without radix, inconsistent with the rest of the codebase where all other `parseInt` calls use `Number.parseInt(x, 10)`
- Replace with `Number.parseInt(year, 10)` for consistency and to avoid potential issues with leading-zero strings being interpreted as octal in older engines
## Test plan
- [x] All 5 usage handler tests pass
- [x] Verified all other parseInt calls in src/ already use explicit radix
Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates `parseDateToMs` in `src/gateway/server-methods/usage.ts` to use `Number.parseInt(..., 10)` instead of bare `parseInt(...)` when converting `YYYY-MM-DD` capture groups into numbers for `Date.UTC(...)`. The change aligns this function with the codebase’s apparent convention of always supplying an explicit radix for `parseInt`, and avoids legacy leading-zero/octal parsing edge cases while keeping the date parsing/UTC semantics unchanged.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a small, localized refactor that only adds an explicit radix to integer parsing in `parseDateToMs` without altering control flow or the date validation regex; no behavioral regressions are apparent from the diff.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#15784: fix: timestamp parsing should convert seconds to milliseconds
by murasame-desu-ai · 2026-02-13
76.3%
#15754: fix: handle Unix timestamps in seconds in parseAbsoluteTimeMs
by MisterGuy420 · 2026-02-13
74.9%
#17380: fix(imessage): reject non-numeric chat_id values to prevent silent ...
by aldoeliacim · 2026-02-15
74.2%
#15875: fix(cron): normalize seconds to milliseconds in timestamps
by Shuai-DaiDai · 2026-02-14
72.7%
#4137: [AI-assisted] test(cli): add missing test cases for parseDurationMs
by sind00 · 2026-01-29
72.3%
#17624: Fix memory flush YYYY-MM-DD placeholder resolution
by grunt3714-lgtm · 2026-02-16
71.6%
#6111: fix: detect float underflow in duration parsing
by T1mn · 2026-02-01
71.3%
#11880: fix: guard decodeURIComponent against malformed percent-encoding in...
by Yida-Dev · 2026-02-08
69.9%
#19611: fix: use local timezone in log file and console timestamps
by tag-assistant · 2026-02-18
69.8%
#10807: fix(config): coerce numeric meta.lastTouchedAt to ISO string
by mcaxtr · 2026-02-07
69.0%