Unreliable application of customizations

(Zach Alexander) #1

My new (Docker-based) Discourse install isn’t consistently applying the custom styles I’ve added:

The header should be orange. Usually it does, but about 30% of the time it appears as white (unstyled), and without the correct font (which is included via a “header” customization).

Any idea why this might be? I could ssh into the container and try to hardcode the customizations there, but I’d really rather not.

(BTW, DNS was only propagated yesterday, if that matters, though I don’t see why it would.)

(Neil Lalonde) #2

I reloaded the site about 20 times, and got the customizations every time. Are you sometimes reloading the page while in the admin section of the site? We deliberately disable customizations for those routes, in case someone breaks their site with some invalid css.

Custom styling doesn't apply to admin pages
CSS/header customizations randomly failing to apply
(Zach Alexander) #3

No, always the front page. Here’s a screencast showing what I’m talking about:

That’s about 20 hard refreshes (Cmd-Shift-R in Chrome), and over a third of them displayed without site customizations. Others on my team reproduced this on their machines.

(Zach Alexander) #4

Upon further testing, I get this behavior when I’m logged in, either as an admin or non-admin (again, on the front page).

I don’t get this behavior when I’m not logged in, as I assume you weren’t @neil.

(Kane York) #5

I think it has something to do with the ?preview-style query parameter setting a cookie (maybe? or something else persistent), which there’s no button to clear.

(Neil Lalonde) #6

I logged in to test, and still don’t see the unstyled site. @riking might be right.

(Zach Alexander) #7

Clearing cookies seemed to fix this for me. (Having my other team member confirm.) Thanks!

(Robin Ward) #8

I have seen this problem many times myself too. @sam might need to take another look at it. I experienced the same behavior where my logged in account could not see changes yet everyone else could.

(Zach Alexander) #9

Yes, a non-admin reported this as well, so it’s not limited to machines used by admin accounts, as I had hoped. :<

(Sam Saffron) #10

We did a bunch of work on this code lately with site customisations etc.

Is this still an issue?

cc @neil

CSS/header customizations randomly failing to apply
(Kane York) #11

This is now fixed.

  • ?preview-style=hex-digits does what it used to do - show that compiled stylesheet
  • ?preview-style= will now, instead of rendering no custom stylesheet, give you the currently selected stylesheet (“Return To Normalcy”)
  • ?preview-style=default will render no custom stylesheet, aka “rescue mode”.

(Kane York) #12