docs(indexer): verify #284 — document clamp(1,max) limit caps #766

Merged
PlasticDigits merged 1 commit from cursor/verify-284-negative-limit-docs-f66a into main 2026-06-05 04:25:03 +00:00
PlasticDigits commented 2026-06-05 04:07:42 +00:00 (Migrated from gitlab.com)

Summary

Verified GitLab #284 (negative limit query param → Postgres 500). The code fix is already on main via MR !749 (hooks.rs .clamp(1, 200) + regression test). This MR only updates docs/indexer-invariants.md so the numeric query caps invariant documents .clamp(1, max) (not the old .min(max) wording) and links the hooks negative/zero regression test.

Verification checklist (issue acceptance criteria)

Acceptance item Command / check Result
?limit=-1 and ?limit=0 never return 500 cd indexer && cargo test --test api_hooks hooks_negative_and_zero_limit_clamp_to_one_not_500 -j 1 -- --test-threads=1 PASS — 200, body.len() <= 1
All list endpoints clamp limit to [1, max] rg 'unwrap_or.*\.min\(' indexer/src/api (expect no matches); rg '\.clamp\(1,' indexer/src/api (15 list-limit sites incl. hooks.rs:61) PASS — no .min() limit clamps remain in api/
Upper-bound caps still enforced cd indexer && cargo test --test security -j 1 -- --test-threads=1 PASS — 21/21
Hooks suite (incl. regression) cd indexer && cargo test --test api_hooks -j 1 -- --test-threads=1 PASS — 4/4
Live smoke (/api/v1/hooks) Indexer dev run + curl -s -o /dev/null -w '%{http_code}' 'http://127.0.0.1:3001/api/v1/hooks?limit=-1' PASS — 200 (not 500) before indexer task halted on LCD block-1
Docs/invariants match implementation docs/indexer-invariants.md numeric query caps row FIX in this MR — was still .min(200) etc.

Follow-ups

  • Add negative/zero limit regression cases to security.rs (and other *_limit_capped tests) so the suite catches future .min() regressions beyond hooks — Brouie noted this gap in the issue thread.
## Summary Verified GitLab **#284** (negative `limit` query param → Postgres 500). The code fix is already on `main` via MR !749 (`hooks.rs` `.clamp(1, 200)` + regression test). This MR only updates `docs/indexer-invariants.md` so the numeric query caps invariant documents `.clamp(1, max)` (not the old `.min(max)` wording) and links the hooks negative/zero regression test. ## Verification checklist (issue acceptance criteria) | Acceptance item | Command / check | Result | |-----------------|-----------------|--------| | `?limit=-1` and `?limit=0` never return 500 | `cd indexer && cargo test --test api_hooks hooks_negative_and_zero_limit_clamp_to_one_not_500 -j 1 -- --test-threads=1` | **PASS** — 200, `body.len() <= 1` | | All list endpoints clamp `limit` to `[1, max]` | `rg 'unwrap_or.*\.min\(' indexer/src/api` (expect no matches); `rg '\.clamp\(1,' indexer/src/api` (15 list-limit sites incl. hooks.rs:61) | **PASS** — no `.min()` limit clamps remain in `api/` | | Upper-bound caps still enforced | `cd indexer && cargo test --test security -j 1 -- --test-threads=1` | **PASS** — 21/21 | | Hooks suite (incl. regression) | `cd indexer && cargo test --test api_hooks -j 1 -- --test-threads=1` | **PASS** — 4/4 | | Live smoke (`/api/v1/hooks`) | Indexer dev run + `curl -s -o /dev/null -w '%{http_code}' 'http://127.0.0.1:3001/api/v1/hooks?limit=-1'` | **PASS** — `200` (not `500`) before indexer task halted on LCD block-1 | | Docs/invariants match implementation | `docs/indexer-invariants.md` numeric query caps row | **FIX** in this MR — was still `.min(200)` etc. | ## Follow-ups - Add negative/zero `limit` regression cases to `security.rs` (and other `*_limit_capped` tests) so the suite catches future `.min()` regressions beyond hooks — Brouie noted this gap in the issue thread.
PlasticDigits commented 2026-06-05 04:11:58 +00:00 (Migrated from gitlab.com)

mentioned in issue #317

mentioned in issue #317
PlasticDigits (Migrated from gitlab.com) merged commit f331d38aa5 into main 2026-06-05 04:25:03 +00:00
PlasticDigits commented 2026-06-05 04:25:06 +00:00 (Migrated from gitlab.com)

mentioned in commit f331d38aa5

mentioned in commit f331d38aa58e9291e377a037e8cd811c51e827bf
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!766
No description provided.