Skip redundant subqueries in users list route#10297
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the 📝 WalkthroughWalkthrough
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
composer.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
app/controllers/api/users.php(1 hunks)composer.json(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/controllers/api/users.php (1)
src/Appwrite/Extend/Exception.php (1)
Exception(7-408)
🔇 Additional comments (2)
composer.json (1)
55-55: Verify skipFilters signature and filter identifiers in utopia-php/database v0.77.xWe couldn’t locate
skipFiltersin the local codebase (it lives in the external utopia-php/database package). Please confirm:
- utopia-php/database 0.77.* declares
public function skipFilters(callable $callback, array $filters)
(or equivalent) so the second argument is supported.- The filters passed at app/controllers/api/users.php:658:
['subQueryAuthenticators','subQuerySessions','subQueryTokens','subQueryChallenges','subQueryMemberships']
exactly match the names expected by the new API.If the signature or any identifier has changed, update the call or adjust the version constraint accordingly.
app/controllers/api/users.php (1)
649-659: Verify skipFilters targets and ensure response shape
All five filters are defined in the global filter registry (app/init/database/filters.php) and listed inPlatform/Action::$filters. Skipping them here will disable the sub-query expansions for:
- Authenticators
- Sessions
- Tokens
- Challenges
- Memberships
Before merging, manually confirm that omitting those sub-query filters still returns every field required by
Response::MODEL_USER_LIST. In particular, verify that none of these skipped filters populate mandatory response fields.
✨ Benchmark results
⚡ Benchmark Comparison
|
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
Checklist