Conversation
📝 WalkthroughWalkthroughThis pull request centralizes cursor extraction across multiple API controllers and HTTP handlers by replacing inline cursor-filtering logic (previously using array_filter + reset) with Query::getCursorQueries($queries, false) and normalizing the result via reset(). Conditional checks were changed from truthy evaluations to explicit comparisons against false (if ($cursor !== false)). Existing cursor validation and subsequent document resolution/error paths were preserved. No public API signatures were modified. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/Appwrite/Platform/Modules/Tokens/Http/Tokens/Buckets/Files/XList.php (2)
72-85: Missing Cursor validator - inconsistent with other modules.This file lacks the
Cursorvalidation step that all other refactored files include. Other modules validate the cursor before extracting its value:$validator = new Cursor(); if (!$validator->isValid($cursor)) { throw new Exception(Exception::GENERAL_QUERY_INVALID, $validator->getDescription()); }Without this validation, invalid cursor queries may proceed and cause unexpected behavior downstream.
Proposed fix
Add the import and validation:
use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; +use Utopia\Database\Validator\Query\Cursor; use Utopia\Database\Validator\UID;if ($cursor !== false) { + $validator = new Cursor(); + if (!$validator->isValid($cursor)) { + throw new Exception(ExtendException::GENERAL_QUERY_INVALID, $validator->getDescription()); + } + $tokenId = $cursor->getValue();
21-23: MissingActionclass import - code will fail at runtime.The class extends
Actionon line 21, but there's no corresponding import statement. Other modules in this PR import it viause Utopia\Platform\Action;.Proposed fix
use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\UID; +use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP;
✨ 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