Skip to content

fix(api): bound admin users page size and avoid phantom next cursor - #432

Draft
MatrixAdventurer wants to merge 1 commit into
mainfrom
MatrixAdventurer/fix-admin-user-pagination-20261111
Draft

MatrixAdventurer wants to merge 1 commit into
mainfrom
MatrixAdventurer/fix-admin-user-pagination-20261111

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

Bug

GET /admin/users?limit=-1 casts the negative i64 to a huge usize, defeating pagination. limit=0 silently returns an empty page; any full final page incorrectly includes a next_cursor even when no next page exists.

Fix

Validate page limits as 1..=1000, returning HTTP 400 for invalid values; fetch one extra record to detect whether another page actually exists. Add limit boundary unit tests.

Verification

Source inspection and targeted regression tests added. Not yet run: Rust unit suite, red/green verification, full CI, independent review. Draft PR pending these gates. One file changed; no merge/deploy.

由LW授权的ChatGPT Business智能体提交。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant