From dfc3d96286b121fe991644009c40177226d4016d Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Mon, 9 Nov 2020 15:31:54 -0500 Subject: [PATCH] Update shell version when admin action taken (#11343) * Update shell version when admin action taken * Update app/controllers/admin/application_controller.rb Co-authored-by: Alex Co-authored-by: Alex --- app/controllers/admin/application_controller.rb | 1 + app/controllers/async_info_controller.rb | 2 +- app/views/shell/_top.html.erb | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/application_controller.rb b/app/controllers/admin/application_controller.rb index af80d7573..d944adffd 100644 --- a/app/controllers/admin/application_controller.rb +++ b/app/controllers/admin/application_controller.rb @@ -17,6 +17,7 @@ module Admin CacheBuster.bust("/tags/onboarding") # Needs to change when suggested_tags is edited. CacheBuster.bust("/shell_top") # Cached at edge, sent to service worker. CacheBuster.bust("/shell_bottom") # Cached at edge, sent to service worker. + CacheBuster.bust("/async_info/shell_version") # Checks if current users should be busted. CacheBuster.bust("/onboarding") # Page is cached at edge. CacheBuster.bust("/") # Page is cached at edge. SiteConfig.admin_action_taken_at = Time.current # Used as cache key diff --git a/app/controllers/async_info_controller.rb b/app/controllers/async_info_controller.rb index 5fb2e02d1..87a1ed8e8 100644 --- a/app/controllers/async_info_controller.rb +++ b/app/controllers/async_info_controller.rb @@ -29,7 +29,7 @@ class AsyncInfoController < ApplicationController set_surrogate_key_header "shell-version-endpoint" # shell_version will change on every deploy. # *Technically* could be only on changes to assets and shell, but this is more fool-proof. - shell_version = ApplicationConfig["RELEASE_FOOTPRINT"] + shell_version = ApplicationConfig["RELEASE_FOOTPRINT"] + SiteConfig.admin_action_taken_at.to_s render json: { version: shell_version }.to_json end diff --git a/app/views/shell/_top.html.erb b/app/views/shell/_top.html.erb index d564929e1..b1f2dad3a 100644 --- a/app/views/shell/_top.html.erb +++ b/app/views/shell/_top.html.erb @@ -42,7 +42,6 @@ " rel="icon" sizes="128x128" /> - " type="application/opensearchdescription+xml" title="<%= community_qualified_name %>" />