Duplicate queries with navigation badges + multi-tenancy
Hello, I'm trying to debug a duplicate query issue and see if this is intended behaviour or not.
Whenever I enable navigation badges on a resource, there seems to be two duplicate requests for every team/group the user is part of.
2 Replies
if I apply the ApplyTenantScopes from the docs you can see that its being fired off for each team regardless of which one you have active
Im still not sure why each one is being fired off twice either
Just curious if you solved this? I just looked at the DebugBar and see the same thing. Rather ineffecient. Trying to run the query as 'return Filament::getTenant()->users->count();' causes a warning about n+1 and eager loading, which seems odd.
@Cyborgmatt From my testing, it seems to do this on first load for all the Teams/Tenants the user belongs to. And then caches it.