Skip to content

api(arweave): negative limit reaches SQL LIMIT and surfaces as 503 db_unavailable #490

Description

@euxaristia

Summary

GET /api/v1/arweave/anchors clamps only the top of the limit (crates/gitlawb-node/src/api/arweave.rs:28, q.limit.min(200)) and binds it straight into LIMIT $2 (db/mod.rs:3836). ?limit=-1 produces a database error that the bare ? mapping (#251) classifies as 503 db_unavailable.

Impact

A client-input bug surfaces as a database-availability error on an anonymous route, and negative values skip the intended pagination contract entirely. Cosmetic per the rubric.

Remediation

  1. Clamp to [1, 200] like the sibling list endpoints (compare GET /api/v1/tasks: clamp limit to match siblings; negative limit returns 500 with raw DB error #399/Fix #399: GET /api/v1/tasks: clamp limit to match siblings; negative limit returns 500 with raw DB error #405).

Proposed labels: kind:bug, crate:node, subsystem:api.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate:nodegitlawb-node — the serving node and REST APIkind:bugDefect fix — wrong or unsafe behaviorsev:lowCosmetic, cleanup, or nice-to-havesubsystem:apiNode REST API request/response surface

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions