Files
fizzy/app/controllers/notifications/trays_controller.rb
T
Jorge Manrubia 958deab2c7 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
2025-10-31 11:34:42 +01:00

10 lines
358 B
Ruby

class Notifications::TraysController < ApplicationController
def show
@notifications = Current.user.notifications.unread.ordered.limit(100)
# 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