הדרך הנכונה להציג טקסט באופן מותנה בתבנית - או לשנות ערך פעמיים ברינדור יחיד

Well, as is often the case when I post things like this, the answer is even more bizarre than I could have imagined.

If I use stuff like {{#if server.value}} and have value pushed out by the MessageBus it works as expected if I do an update from the Rails console. I can set it to nil/not nil and the section of the page (dis)appears as expected. When I run my Ansible task from a terminal, Ansible pushes a new value via a route, which updates the record, which pushes it to the message bus and the section of the template appears as expected.

But, if Ansible gets run by a job by Discourse, I still see Rails claiming to push the stuff to the message bus. And I see in the browser javascript console that a computed function that tracks that value is firing and the value is null. If I reload the browser, the data is there and the page renders as expected. Maybe this is some vaguary of the dev environment and it’ll be different on production.

Maybe this is related?

Well, I’m still worried about that error, but I added

         window.location.reload(true);

to my action and the page reloads and everything seems to work after that.