Performance & conventions audit batch — no behaviour change, all query hygiene.
Fixed
- Post-header primary-group chip no longer N+1s.
sgPrimaryGroupmoved into an injectedUserResourceFieldsclass and its relations are eager-loaded on the User/Post/Discussion endpoints (mirroring core'suser.groups), so a 20-author page no longer fires ~60 correlated lookups. - Group directory teasers batch-load.
recentDiscussionsreads an eager-loaded relation instead of oneLIMITquery per group card. - Member list
canRemove/canMutememoized. The per-(actor, group) moderator lookup runs once per page instead of 40 correlated subqueries; endpoint policies are unchanged. - Poll voting eager-loads the discussion's group (one fewer SELECT).
- Migrations 000003/000020 now document why the raw closure form is intentional.
Update: composer update ernestdefoe/social-groups then php flarum cache:clear.