[FIX] Loading theme CSS on first server startup#13953
Conversation
| res.setHeader('Content-Type', 'text/css; charset=UTF-8'); | ||
| res.setHeader('Content-Length', currentSize); | ||
| res.setHeader('ETag', `"${ currentHash }"`); | ||
| res.write(theme.getCss()); |
There was a problem hiding this comment.
Would this actually exist?
I know let is defined outside this scope... but will this actually persist?
There was a problem hiding this comment.
yes =)
Variables declared by let have their scope in the block for which they are defined, as well as in any contained sub-blocks.
There was a problem hiding this comment.
actually, if you're worried about theme variable, it is a const that was being used before as well
|
@sampaiodiego could this be the reason that breaks the loading of theme.css when using Rocketchat in a subdirectory? I'm testing on develop branch and found out that now it asks for /theme.css which doesn't exist. |
I can take a look.. |
|
Thanks for the quick response! More info: It also happens in |
|
@facundomedica can you please help testing #14015 ? |
|
@sampaiodiego thank you, is there a way to have this uploaded to docker hub? I've been testing from there and I don't have the set up to run it in other way |
|
@facundomedica you can test with docker image |
Change the technique used to serve the
theme.cssfile.Previous code was overwriting an internal meteor function that read/validate all assets of the app and if perhaps the CSS theme was already "ready" (the less was compiled), it was then added to assets list. This was causing an issue though, that on the first start of a server, where the compiled CSS was not yet saved on DB, then the
theme.csswas being served. Causing the UI to look like this:Previously, to fix the above issue a restart was required.