Ok, I went for it. Here’s the PR which fixes the issue
https://github.com/discourse/discourse/pull/10486