Conversation
📝 WalkthroughWalkthroughThe pull request introduces several improvements across four files. The Realtime adapter refactors subscription storage from simple query strings to composite data objects containing both original strings and pre-parsed Query objects, updating all associated metadata and subscriber resolution methods accordingly. Two worker classes add try-finally blocks for guaranteed resource cleanup: StatsUsage ensures statDocuments are cleared after database writes, and Webhooks ensures cURL handles are closed even if exceptions occur. The Documents Action processor adds a depth parameter with early exit logic to prevent infinite recursion when processing related document relationships beyond a maximum depth threshold. Overall, net change of 78 lines added and 64 removed across diverse modules. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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
🧪 Generate unit tests (beta)
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 (1)
src/Appwrite/Messaging/Adapter/Realtime.php (1)
293-312:⚠️ Potential issue | 🟡 MinorHandle select(*) anywhere in the query list for empty payloads.
Line 300-301: The empty-payload shortcut only checks the first parsed query. If select() appears later in the list, empty payload events won’t match even though they should. Consider scanning all queries for select().
💡 Suggested fix
- $isEmptyPayloadAndSelectAll = !empty($parsedQueries) && RuntimeQuery::isSelectAll($parsedQueries[0]) && empty($payload); + $hasSelectAll = false; + foreach ($parsedQueries as $parsedQuery) { + if (RuntimeQuery::isSelectAll($parsedQuery)) { + $hasSelectAll = true; + break; + } + } + $isEmptyPayloadAndSelectAll = $hasSelectAll && empty($payload);
✨ 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