Forem Creators and Builders 🌱

Cover image for Chat issue resolved in self-hosting Forem.
Akhil Naidu
Akhil Naidu

Posted on

Chat issue resolved in self-hosting Forem.

As previously mentioned in one of my posts, known issues in self-hosting; there is an issue with Forem Connect(or chat feature).

Expected Behaviour

When a user sends a message to one of his followers/following, the expected behaviour was:

  1. A preview on the sender side(In his chat connect panel)
  2. A notification about the message to another party

For this to work correctly, the self-hosting admins must configure their ENV variables of Pusher.

What is Happening

Even though the self-hosting Forem was updated with Pusher ENV variables, the sender could not see the messages (sent messages were not displayed), and the receiver was not notified in their Forem (in real-time). To see the changes, even for the sent message previews =>, users must refresh their page.

Cause

Today, when I confirmed that this issue was in no way related to Pusher configuration, I gave a quick look at their ruby documentation and thought to do some experiments with my Forem fork. But fortunately, the issue was directly visible in the pusher.js file

For some reason, in line-13, the cluster id was manual mentioned to be us2. So this is causing an issue for other Pusher Channels of different regions.

How I tried to Resolve this

The moment I found this manually configured cluster variable, I quickly created another Pusher Channel in us2 Location and updated the ENV variables of the Pusher.

Now everything seems to be working as usual.

Way Forward

With this post and changes, now I could host Forem in dokku and Heroku without a single issue. I'm hoping that the codebase can provide more than one region of the cluster. If it was not possible for some reason, I'm willing to write small documentation which helps my team and self-hosting Forem members of Heroku or Dokku.

Top comments (1)

Collapse
 
lee profile image
Lee

sounds like it needs an issue raising for some futher generalisation, nice find!