Summary
Several config values — page size limits, webhook max count, rate limit thresholds — are read from environment variables as strings and must be positive integers. A shared config parser helper should centralize this coercion so invalid env values are caught at startup rather than at runtime.
Scope
- Add
parsePositiveInt(value: string | undefined, name: string, defaultValue: number): number helper
- Returns the parsed integer if valid and positive
- Returns
defaultValue if the value is undefined
- Throws a descriptive startup error if the value is defined but not a valid positive integer
- Add unit tests for: valid integer, undefined uses default, zero throws, negative throws, non-numeric throws
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Several config values — page size limits, webhook max count, rate limit thresholds — are read from environment variables as strings and must be positive integers. A shared config parser helper should centralize this coercion so invalid env values are caught at startup rather than at runtime.
Scope
parsePositiveInt(value: string | undefined, name: string, defaultValue: number): numberhelperdefaultValueif the value is undefinedAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram