fix(indexer): clamp /api/v1/hooks limit to >=1 (#284) #749
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic!749
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "qa/284-clamp-hooks-limit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up on #284. The
.min()->.clamp(1, MAX)sweep missedget_hook_events(indexer/src/api/hooks.rs:59), so a negativelimitstill reached Postgres as a negativeLIMITand 500'd on the registered/api/v1/hooksroute.GET /api/v1/hooks?limit=-1-> 500 (controls?limit=5/?limit=0-> 200). It was the lone surviving.min()limit clamp inindexer/src/api/.This clamps it to
>=1like the other 14 sites, plus a regression test (hooks_negative_and_zero_limit_clamp_to_one_not_500) — the original fix had no negative/zero-limit coverage, every*_limit_cappedtest only asserts the upper bound. api_hooks 4/4.No closing keyword — leaving the close to @PlasticDigits.
mentioned in issue #284
mentioned in commit
9edb3b6430mentioned in commit
6f620546a6mentioned in merge request !766
mentioned in issue #317