1
0
Fork 0
mirror of https://gitea.com/gitea/tea.git synced 2026-04-25 08:37:48 +02:00
tea/modules
Alain Thiffault 5103496232 fix(pagination): replace Page:-1 with explicit pagination loops (#967)
## Summary

\`Page: -1\` in the Gitea SDK calls \`setDefaults()\` which sets both \`Page=0\` and \`PageSize=0\`, resulting in \`?page=0&limit=0\` being sent to the server. The server interprets \`limit=0\` as "use server default" (typically 30 items via \`DEFAULT_PAGING_NUM\`), not "return everything". Any resource beyond the first page of results was silently invisible.

This affected 8 call sites, with the most user-visible impact being \`tea issues edit --add-labels\` and \`tea pulls edit --add-labels\` silently failing to apply labels on repositories with more than ~30 labels.

## Affected call sites

| File | API call | User-visible impact |
|---|---|---|
| \`modules/task/labels.go\` | \`ListRepoLabels\` | \`issues/pulls edit --add-labels\` fails silently |
| \`modules/interact/issue_create.go\` | \`ListRepoLabels\` | interactive label picker missing labels |
| \`modules/task/pull_review_comment.go\` | \`ListPullReviews\` | review comments truncated |
| \`modules/task/login_ssh.go\` | \`ListMyPublicKeys\` | SSH key auto-detection fails |
| \`modules/task/login_create.go\` | \`ListAccessTokens\` | token name deduplication misses existing tokens |
| \`cmd/pulls.go\` | \`ListPullReviews\` | PR detail view missing reviews |
| \`cmd/releases/utils.go\` | \`ListReleases\` | tag lookup fails on repos with many releases |
| \`cmd/attachments/delete.go\` | \`ListReleaseAttachments\` | attachment deletion fails when many attachments exist |

## Fix

Each call site is replaced with an explicit pagination loop that follows \`resp.NextPage\` until all pages are exhausted.

Reviewed-on: https://gitea.com/gitea/tea/pulls/967
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Alain Thiffault <athiffau@effectivemomentum.com>
Co-committed-by: Alain Thiffault <athiffau@effectivemomentum.com>
2026-04-23 17:06:42 +00:00
..
api feat: store OAuth tokens in OS keyring via credstore (#926) 2026-03-12 02:49:14 +00:00
auth refactor: code cleanup across codebase (#947) 2026-04-08 03:38:49 +00:00
config refactor: code cleanup across codebase (#947) 2026-04-08 03:38:49 +00:00
context fix(context): skip local repo detection for repo slugs (#960) 2026-04-20 19:39:42 +00:00
debug add debug mode and update readme (#805) 2025-09-10 19:10:02 +00:00
filelock Move versions/filelocker into dedicated subpackages, and consistent headers in http requests (#888) 2026-02-05 18:05:43 +00:00
git refactor: code cleanup across codebase (#947) 2026-04-08 03:38:49 +00:00
httputil Move versions/filelocker into dedicated subpackages, and consistent headers in http requests (#888) 2026-02-05 18:05:43 +00:00
interact fix(pagination): replace Page:-1 with explicit pagination loops (#967) 2026-04-23 17:06:42 +00:00
print feat(pulls): add ci status field to pull request list (#956) 2026-04-10 17:29:15 +00:00
task fix(pagination): replace Page:-1 with explicit pagination loops (#967) 2026-04-23 17:06:42 +00:00
theme feat: store OAuth tokens in OS keyring via credstore (#926) 2026-03-12 02:49:14 +00:00
utils refactor: code cleanup across codebase (#947) 2026-04-08 03:38:49 +00:00
version Move versions/filelocker into dedicated subpackages, and consistent headers in http requests (#888) 2026-02-05 18:05:43 +00:00