Return empty on no collection, fallback to route validation#10719
Return empty on no collection, fallback to route validation#10719
Conversation
📝 WalkthroughWalkthroughThe Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ 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: 2
🧹 Nitpick comments (1)
src/Appwrite/Utopia/Request/Filters/V20.php (1)
140-162: Consider the architectural implications of silent failures.This backward compatibility filter's purpose is to preserve 1.7.x behavior by auto-adding relationship selects. Silently suppressing database/collection lookup failures defeats this purpose—the filter will return empty relationship keys and fail to provide backward compatibility, without any indication that something went wrong.
Consider these alternatives:
Let exceptions propagate and handle them at a higher level where proper error responses can be generated.
Add fallback behavior with proper logging:
- Log when databases/collections can't be found
- Include metrics/monitoring for silent failure rates
- Add request tracing to understand impact
Document the decision: If silent failures are intentional (per the PR title "fallback to route validation"), add comments explaining:
- Why errors are suppressed here
- How route validation will catch these cases
- What the expected user experience is
Can you clarify the intended behavior when database or collection lookups fail? Should clients receive:
- An empty response with 200 status?
- A validation error from route handlers?
- A specific error message?
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Appwrite/Utopia/Request/Filters/V20.php(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: E2E Service Test (VCS)
- GitHub Check: E2E Service Test (Users)
- GitHub Check: E2E Service Test (Health)
- GitHub Check: E2E Service Test (Webhooks)
- GitHub Check: E2E Service Test (Proxy)
- GitHub Check: E2E Service Test (Storage)
- GitHub Check: E2E Service Test (Teams)
- GitHub Check: E2E Service Test (Sites)
- GitHub Check: E2E Service Test (Account)
- GitHub Check: E2E Service Test (Functions)
- GitHub Check: E2E Service Test (Databases/TablesDB)
- GitHub Check: E2E Service Test (Locale)
- GitHub Check: E2E Service Test (Realtime)
- GitHub Check: E2E Service Test (Avatars)
- GitHub Check: E2E Service Test (Site Screenshots)
- GitHub Check: E2E Service Test (Dev Keys)
- GitHub Check: E2E General Test
- GitHub Check: Unit Test
- GitHub Check: Benchmark
- GitHub Check: scan
✨ 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