Files
OmniRoute/tests
Diego Rodrigues de Sa e Souza 9db3c03faa fix(usage): parse numeric-string quota reset timestamps as Unix sec/ms
`parseResetTime` in `open-sse/services/usage.ts` and `codexUsageQuotas.ts`
already handled `number` reset values with the `< 1e12 ? * 1000 : value`
seconds-vs-ms heuristic, but for `string` inputs it always called
`new Date(str)`. When a provider returned the reset timestamp as a
numeric string (e.g. `"1700000000"`), `new Date(str)` returned Invalid
Date, the try/catch swallowed it, and the function returned `null` —
the reset window was silently dropped from quota snapshots.

Numeric strings (`/^\d+$/`) are now detected and treated as Unix
timestamps with the same seconds-vs-ms heuristic. ISO/parseable strings
are untouched. Applied symmetrically in both parsers.

TDD: 2 failing tests added in `tests/unit/usage-utils.test.ts` for the
seconds-string and ms-string cases; both green after the fix (47/47 in
file, 27/27 in adjacent usage/quota tests).

Inspired-by: https://github.com/decolua/9router/pull/768

Co-authored-by: Zhen <zhen@dkzhen.org>
2026-06-21 14:05:56 -03:00
..
2026-06-17 19:26:32 -03:00
2026-05-23 01:46:59 -03:00
2026-06-20 07:09:43 -03:00
2026-06-19 06:49:01 -03:00
2026-06-10 13:49:08 -03:00
2026-06-13 17:27:40 -03:00