Fix databases worker cache clearing bug#10294
Conversation
Co-authored-by: jakeb994 <[email protected]>
|
Cursor Agent can help with this pull request. Just |
📝 WalkthroughWalkthroughThe Databases worker adds collection-level cache invalidation alongside existing document-level cache purges for attribute and index operations. For createAttribute and deleteAttribute, after purging document caches for the main and any related collections, purgeCachedCollection is also invoked for those collections. For createIndex and deleteIndex, the finally blocks now call purgeCachedCollection for the affected collection after purging its document cache. No public interfaces are changed. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ 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). (11)
🔇 Additional comments (6)
✨ 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! |
✨ Benchmark results
⚡ Benchmark Comparison
|
|
Handling in utopia |
|
Going to go with this approach for short term as the utopia side has some complexities |
What does this PR do?
This PR fixes a cache invalidation issue in the Databases worker (
src/Appwrite/Platform/Workers/Databases.php). Previously, after creating or deleting attributes and indexes, the collection structure cache was not being properly purged. This led to the UI displaying attributes asprocessingeven after successful creation, as it was still serving stale cached data.The fix ensures that both the collection document cache and the collection structure cache are purged, forcing the UI to fetch the most up-to-date collection information.
Test Plan
processingstate indefinitely or until another collection-modifying action is performed.Related PRs and Issues
Checklist