Skip to content

feat: add total param to remaining listX endpoints - #13991

Merged
Meldiron merged 5 commits into
appwrite:mainfrom
jaysomani:feat/list-endpoints-total-param
Oct 1, 2026
Merged

Meldiron merged 5 commits into
appwrite:mainfrom
jaysomani:feat/list-endpoints-total-param

Conversation

@jaysomani

Copy link
Copy Markdown
Contributor

Adds total param (bool, default true) to 24 list endpoints missing it, for consistency with the existing 53 that already have it.

When total=false the response total is 0 and the count query is skipped on database endpoints. Items are always returned regardless.

5 endpoints skipped: usage/events, usage/gauges, account/mfa/factors, users/:userId/mfa/factors, projects/:projectId/stages — none return a total field.

E2E tests added for all 24 endpoints testing both true and false values.

What does this PR do?

(Provide a description of what this PR does and why it's needed.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

Adds total param (bool, default true) to 24 list endpoints missing it,
for consistency with the existing 53 that already have it.

When total=false the response total is 0 and the count query is skipped
on database endpoints. Items are always returned regardless.

5 endpoints skipped: usage/events, usage/gauges, account/mfa/factors,
users/:userId/mfa/factors, projects/:projectId/stages — none return a
total field.

E2E tests added for all 24 endpoints testing both true and false values.
@ghost

ghost commented Sep 29, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The incremental change is indentation-only and introduces no behavioral defects.

Adds an optional total boolean, defaulting to true, to 24 list endpoints; disabling it preserves returned items while setting total to zero and skipping database counts where applicable. Account changes also support retaining the current session during bulk deletion, configurable email/password session duration, browser-bound OAuth2 state, and project-bound JWT claims. E2E coverage exercises these contracts and security regressions for deployments, function domains, site authorization redirects, and GitHub webhook signatures.

Latest changes: The newest commit only corrects the indentation of the closing brace in the account session-list totals test, without changing behavior.

Verdict New comments Fixed Still open
💬 Commented 0 0 0

Note

@jaysomani does not have write access to this repository, so Hansi does not approve automatically. A maintainer can review and approve.

📂 Walkthrough · 32
File Change
app/controllers/api/account.php Adds session-list totals, selective session deletion, login duration, OAuth2 browser binding, and project-bound JWT claims.
app/controllers/api/locale.php Adds optional totals to seven locale lists.
src/Appwrite/Platform/Modules/Console/Http/OAuth2Providers/XList.php Adds optional totals to the OAuth2 provider list.
src/Appwrite/Platform/Modules/Console/Http/Scopes/{Organization,Project}/XList.php Adds optional totals to organization and project scope lists.
src/Appwrite/Platform/Modules/Databases/Http/{Databases,DocumentsDB,TablesDB,VectorsDB}/Transactions/XList.php Registers optional totals on transaction lists and conditionally skips counting.
src/Appwrite/Platform/Modules/Functions/Http/{Runtimes,Specifications}/XList.php Adds optional totals to runtime and specification lists.
src/Appwrite/Platform/Modules/Notifications/Http/Notifications/XList.php Adds optional totals and conditionally skips the database count.
src/Appwrite/Platform/Modules/Sites/Http/{Frameworks,Specifications,Templates}/XList.php Adds optional totals to site configuration lists.
src/Appwrite/Platform/Modules/VCS/Http/Installations/{Namespaces,Repositories,Repositories/Branches}/XList.php Adds optional totals to namespace, repository, and branch lists.
tests/e2e/Services/Account/AccountCustomClientTest.php Tests account totals, session retention, login duration, and OAuth2 browser binding; corrects a test brace's indentation.
tests/e2e/Services/Console/ConsoleConsoleClientTest.php Tests optional totals on console lists.
tests/e2e/Services/Databases/{Transactions,VectorsDB/Transactions}/TransactionsBase.php Tests transaction lists with totals enabled and disabled.
tests/e2e/Services/Functions/FunctionsCustomServerTest.php Tests optional totals, deployment traversal rejection, and cross-project JWT requests.
tests/e2e/Services/Locale/LocaleBase.php Tests locale lists with totals enabled and disabled.
tests/e2e/Services/Notifications/NotificationsBase.php Tests notification lists with totals enabled and disabled.
tests/e2e/Services/Sites/SitesCustomClientTest.php Tests optional totals on client-visible site lists.
tests/e2e/Services/Sites/SitesCustomServerTest.php Tests optional totals, safe authorization redirects, and deployment traversal rejection.
tests/e2e/Services/VCSGitHub/VCSGitHubConsoleClientTest.php Tests optional totals and invalid webhook signatures, and signs test push payloads.
src/Appwrite/Platform/Modules/Console/Http/Scopes/Organization/XList.php Add total param.
src/Appwrite/Platform/Modules/Console/Http/Scopes/Project/XList.php Add total param.
src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/XList.php Add total param and skip count when false.
src/Appwrite/Platform/Modules/Databases/Http/DocumentsDB/Transactions/XList.php Register total param on the subclass.
src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Transactions/XList.php Register total param on the subclass.
src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Transactions/XList.php Register total param on the subclass.
src/Appwrite/Platform/Modules/Functions/Http/Runtimes/XList.php Add total param.
src/Appwrite/Platform/Modules/Functions/Http/Specifications/XList.php Add total param.
src/Appwrite/Platform/Modules/Sites/Http/Frameworks/XList.php Add total param.
src/Appwrite/Platform/Modules/Sites/Http/Specifications/XList.php Add total param.
src/Appwrite/Platform/Modules/Sites/Http/Templates/XList.php Add total param.
src/Appwrite/Platform/Modules/VCS/Http/Installations/Namespaces/XList.php Add total param.
src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/Branches/XList.php Add total param.
src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/XList.php Add total param.

Reviewed the commits since ee4160f · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adds optional total count parameter to list endpoints.

The PR should not merge until total=false avoids full repository counting for restricted GitHub searches.

Fix All in Claude CodeFindings

  1. P1 Repository counting still runs ▶
Fix with agent prompt
### Issue 1
src/Appwrite/Platform/Modules/VCS/Http/Installations/Repositories/XList.php:330
For a restricted GitHub installation with a search term, `total=false` only changes the response after `searchRepositories()` has fetched every accessible repository page, filtered the results, and counted them. A request for a small page can therefore still make many provider calls, remain slow, or hit provider rate limits instead of skipping the count work promised by this parameter.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds an optional total parameter to list endpoints across account, locale, console, database transactions, functions, notifications, sites, and VCS, with end-to-end coverage for both values.

  • Database-backed lists skip their count query when total=false; other lists return zero while retaining their items.
  • GitHub repository search still performs full-list work when the total is disabled.

Reviews (1) · Last reviewed commit: "Merge branch 'main' into feat/list-endpo..."

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Meldiron
Meldiron merged commit 4f07216 into appwrite:main Oct 1, 2026
49 checks passed
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.

2 participants