Fix: problem with notifications not dismissing due to HTTP caching
The problem was related to tying the invalidation to the association of unread notifications. Its cache key can remain constant as you read old notifications. https://app.box-car.com/5986089/cards/2620/edit
This commit is contained in:
@@ -2,6 +2,8 @@ class Notifications::TraysController < ApplicationController
|
||||
def show
|
||||
@notifications = Current.user.notifications.unread.ordered.limit(100)
|
||||
|
||||
fresh_when @notifications
|
||||
# Invalidate on the whole set instead of the unread set since the max updated at in the unread set
|
||||
# can stay the same when reading old notifications.
|
||||
fresh_when Current.user.notifications
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user