I have a fix in the works - @martin what do you think?
https://github.com/discourse/discourse/pull/38870