securedrop icon indicating copy to clipboard operation
securedrop copied to clipboard

Ensure updated logo is shown immediately after logo change

Open redshiftzero opened this issue 7 years ago • 2 comments

Description

Followup from #2769. In the admin interface, a preview of the current logo is shown on the system config page. This image automatically after update of the logo due to the addition of the new autoversion jinja filter to bust the cache. However, the sidebar image does not automatically update (see comment below for why trivially adding the autoversion jinja filter is not ideal). We should consider adding a more sophisticated autoversion that autoversions all assets on the journalist interface only when they change.

From a comment from @dachary:

It would be helpful to add more information about the image cache on the config page. Although the image is updated immediately in the form, the logo displayed elsewhere is still cached and shows the old one. Something like: "Hit Control-F5 to clear the cache and see the new logo everywhere" maybe ? An alternative would be to |autoversion all logo.png but that would effectively always invalidate the cache, always, for everyone. Another idea would be to have a more sophisticated autoversion, used on every logo.png that adds the ?XXXX everywhere but only during X hours after the logo.png is modified.

User Stories

As a SecureDrop administrator, I want to update my admin logo without being confused.

redshiftzero avatar Jan 03 '18 22:01 redshiftzero

@nathandyer is going to do some investigation against a prod instance, this could be a good candidate for a hackathon/hacktoberfest issue.

zenmonkeykstop avatar Oct 20 '22 15:10 zenmonkeykstop

Sharing some results after testing against my SecureDrop instance, running SecureDrop 2.5.0 on two Intel NUC 11s:

From Default Logo

Procedure:

  1. Loaded Journalist interface in Tor browser
  2. Loaded Source interface in Tor browser on another system, and confirmed it is using the default SecureDrop logo
  3. Opened Admin settings in Journalist interface, clicked "Instance configuration", browsed for a new Logo Image, then clicked "Update Logo"

Result:

  • Admin page reloaded, showed new image, received "Image uploaded" checkmark
  • On source page, logo stayed static. Refreshed the page (without busting the cache) and the new logo appeared.

With Custom Logo

Procedure:

  1. With custom logo set, returned to Admin interface, browsed for a new image, and clicked "Update Logo"

Result:

  • Admin interface reloaded, and showed the "Image uploaded" checkmark, but it's still showing the old (previous) logo
  • Refreshing the Source interface shows new logo (did not need to manually bust the cache)
  • Busting the cache and refreshing the Admin interface shows new custom logo

Repeated Results

For the sake of verifying consistency, I repeated the process again and observed the same behavior. I felt it necessary to do this due to some significant Tor instability during the first trial.

nathandyer avatar Oct 21 '22 15:10 nathandyer