-
-
Notifications
You must be signed in to change notification settings - Fork 22
Fixed N+1 query in AccountFollowsView domain block checks
#1486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed N+1 query in AccountFollowsView domain block checks
#1486
Conversation
ref https://linear.app/ghost/issue/BER-3013 Replaced per-account `domainIsBlocked` calls with a single `getBlockedDomains` query that returns all blocked domains upfront as a `Set` for `O(1)` lookups
WalkthroughThis pull request refactors the domain blocking mechanism in the moderation service from per-entity boolean checks to a batch retrieval approach. The changes replace the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (3)**/*.test.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.integration.test.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-11-25T10:54:15.904ZApplied to files:
🧬 Code graph analysis (1)src/http/api/views/account.follows.view.ts (2)
⏰ 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). (3)
🔇 Additional comments (6)
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 |
| return domainBlock === undefined; | ||
| } | ||
|
|
||
| async domainIsBlocked( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed domainIsBlocked as its not used anywhere anymore
sagzy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix @mike182uk!
CI seems to be failing for a random reason, triggered it again
ref https://linear.app/ghost/issue/BER-3013
Replaced per-account
domainIsBlockedcalls with a singlegetBlockedDomainsquery that returns all blocked domains upfront as aSetforO(1)lookups