`--limit` accepts non-integer values and sends a truncated number
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli
Research direction
Start in src/lib/pagination.ts at parseLimitOpt, where the issue says parseInt accepts partial numeric input. Check the existing invalid_limit error handling and run a list command with values such as 2.5 or 25abc against the described test server. Done means invalid values produce an error and exit code 1 without sending a request, while valid integer limits continue to work.
Written by the indexing model from the issue text.
Description
resend <resource> list --limit <n> is parsed with parseInt in src/lib/pagination.ts (parseLimitOpt). parseInt keeps the leading digits and ignores the rest, so non-integer input is not rejected even though the error message says --limit must be an integer between 1 and 100. The command sends a different limit and exits 0.
Steps to reproduce
-
Start any HTTP server on port 4599 that logs requests and returns
{"object":"list","has_more":false,"data":[]}. -
Run:
RESEND_BASE_URL=http://127.0.0.1:4599 RESEND_API_KEY=re_test \ resend emails list --limit 2.5 --json
Expected
invalid_limit error, exit code 1, no request sent.
Actual
The server receives GET /emails?limit=2 and the command exits 0. --limit 25abc sends limit=25 and --limit 1,000 sends limit=1.
This affects every command that uses parseLimitOpt (all list commands and the other paginated commands).
- Dominant language
- TypeScript
- Stars
- 406
- Forks
- 42
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from resend/resend-cli
-
Dependency DashboardOpen
Difficulty 4/5 3-5 days Newbie friendliness 20/100
resend/resend-cli#26 ·
Maintainers usually reply within 1 day
All issues in resend/resend-cli
Similar issues
-
calcite-ui-icons enhancement impact - p3 - not time sensitive needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Esri/calcite-design-system#15467 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
diegosouzapw/OmniRoute#18390 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
guilhermerodz/input-otp#157 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
davidjerleke/embla-carousel#1414 ·
Maintainers usually reply within 4 days