Fix incorrect filter cache key sometimes causing incorrect filters to be applied (#39698)
This commit is contained in:
parent
635764b72f
commit
94b897fdee
@ -131,7 +131,7 @@ class StatusCacheHydrator
|
||||
|
||||
def mapped_applied_custom_filter(account, status)
|
||||
CustomFilter
|
||||
.apply_cached_filters(CustomFilter.cached_filters_for(account), status)
|
||||
.apply_cached_filters(CustomFilter.cached_filters_for(account.id), status)
|
||||
.map { |filter| serialized_filter(filter) }
|
||||
end
|
||||
|
||||
|
||||
@ -68,6 +68,8 @@ class CustomFilter < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.cached_filters_for(account_id)
|
||||
raise ArgumentError unless account_id.is_a?(String) || account_id.is_a?(Integer)
|
||||
|
||||
active_filters = Rails.cache.fetch("filters:v3:#{account_id}") do
|
||||
filters_hash = {}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user