From ec119b774a939b5cde8e820cccffefd2806c5a49 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 10 Oct 2025 11:17:26 -0400 Subject: [PATCH] Remove the caching around Identity-related fragments The Identity table read should be OK given the menu is etagged and the untenanted page should be a rarity. --- app/controllers/my/menus_controller.rb | 2 +- app/views/filters/menu/_places.html.erb | 6 ++--- app/views/sessions/login_menu.html.erb | 29 +++++++++++-------------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/app/controllers/my/menus_controller.rb b/app/controllers/my/menus_controller.rb index a81705df3..2fac3d8d0 100644 --- a/app/controllers/my/menus_controller.rb +++ b/app/controllers/my/menus_controller.rb @@ -2,6 +2,6 @@ class My::MenusController < ApplicationController include FilterScoped def show - fresh_when @user_filtering + fresh_when etag: [ @user_filtering, Current.identity_token ] end end diff --git a/app/views/filters/menu/_places.html.erb b/app/views/filters/menu/_places.html.erb index c7afd625e..65b530f5c 100644 --- a/app/views/filters/menu/_places.html.erb +++ b/app/views/filters/menu/_places.html.erb @@ -3,9 +3,7 @@ <%= filter_place_menu_item user_path(Current.user), "My Profile", "person" %> <%= filter_place_menu_item notifications_path, "Notifications", "bell" %> <%= filter_place_menu_item notifications_settings_path, "Notification Settings", "settings" %> - <% cache [ Current.user, Current.identity_token ] do %> - <% Current.user.identity.memberships.where.not(user_tenant: Current.user.tenant).each do |membership| %> - <%= filter_place_menu_item root_url(script_name: "/#{membership.user_tenant}"), "#{membership.account_name}", "logo-color", new_window: true %> - <% end %> + <% Current.user.identity.memberships.where.not(user_tenant: Current.user.tenant).each do |membership| %> + <%= filter_place_menu_item root_url(script_name: "/#{membership.user_tenant}"), "#{membership.account_name}", "logo-color", new_window: true %> <% end %> <% end %> diff --git a/app/views/sessions/login_menu.html.erb b/app/views/sessions/login_menu.html.erb index 71d4db1a7..4f9b7c826 100644 --- a/app/views/sessions/login_menu.html.erb +++ b/app/views/sessions/login_menu.html.erb @@ -3,21 +3,18 @@

Fizzy

- <% cache [ Current.user, Current.identity_token ] do %> - <%# Bump for rollout 2025-10-10 %> - <% identity = Identity.find_signed(Current.identity_token.id) %> - <% memberships = identity&.memberships %> - <% if memberships.present? %> -

Your Fizzy Accounts

- - <% else %> -

You don't have any existing Fizzy accounts.

- <% end %> + <% identity = Identity.find_signed(Current.identity_token.id) %> + <% memberships = identity&.memberships %> + <% if memberships.present? %> +

Your Fizzy Accounts

+ + <% else %> +

You don't have any existing Fizzy accounts.

<% end %>