From ace5c9000718de23d419c6c2ae908913c7851fb3 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Tue, 3 Feb 2026 20:51:34 +0530 Subject: [PATCH] use cache for only admins --- app/finders/conversation_finder.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/finders/conversation_finder.rb b/app/finders/conversation_finder.rb index 5a10ddc13..a59979780 100644 --- a/app/finders/conversation_finder.rb +++ b/app/finders/conversation_finder.rb @@ -173,8 +173,9 @@ class ConversationFinder # Check if filtering by status only (no other filters applied) filtering_by_status_only = FILTER_PARAMS.none? { |key| params[key].present? } - # Use cache if feature is enabled, filtering by status only, and status is not 'all' + # Use cache only for admins (non-admins have inbox permission filters applied) use_cache = current_account.feature_enabled?(:counter_cache_optimization) && + @is_admin && filtering_by_status_only && params[:status] != 'all'