# הודעה פרטית קבוצתית - בעיית Message Bus

**URL:** <https://meta.discourse.org/t/group-private-message-message-bus-issue/181009>\
**Category:** Bug\
**Created:** [24 בפברואר,‏ 2021,‏ 2:51pm UTC](https://meta.discourse.org/t/group-private-message-message-bus-issue/181009 "2021-02-24T14:51:25Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![danjw](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@danjw](https://meta.discourse.org/u/danjw)\
**Post date:** [24 בפברואר,‏ 2021,‏ 2:51pm UTC](https://meta.discourse.org/t/group-private-message-message-bus-issue/181009/1 "2021-02-24T14:51:25Z")

</div>

**Context**  
We have a system whereby we programmatically add users to groups, via the API, and automatically create private messages for individual groups, all via the API.

For example, we might have a group called: cooking-class-101

For which we’ll create a private message with cooking-class-101 & system as 2 participants in the private message.

This has worked really well for us as a way of automatically creating private group chats for groups of people.

**The Problem**  
The issue we’re seeing is that for _regular users_ who are part of the group, the message bus does not return any updates when new posts are added to the topic.

For example, we have a group private message with topic ID 123. We can see that the message bus is subscribed to the channel `topic/123`, yet if another user creates a post on the topic, nothing is returned by the message bus and therefore the latest post does not automatically show.

We have confirmed that the message bus is generally working as expected as it does correctly return data on the `topic/presence/123` channel.

The counter to the above is that for _admin users_ who are part of the group that has been added to the private message, the message bus **does** correctly return data on the `topic/123` channel and the new post is therefore correctly shown on the topic in real time.

We’ve also confirmed that if a _regular user_ who is a member of the group is separately invited to participate in the topic (so now we have cooking-class-101, system & regular-user participating), then they start to correctly receive responses from the message bus on the `topic/123` channel and therefore see new posts in real time.

**Research**  
Digging around in the Discourse code brings me to the following which looks as though for private message topics, it might not be notifying groups of new posts being published: [discourse/app/models/post.rb at b7b81afe553a79f58f79f49a6c2ceff831aa4ec7 · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/b7b81afe553a79f58f79f49a6c2ceff831aa4ec7/app/models/post.rb#L214-L219)

I’m not entirely sure what `topic.allowed_users` in the link above is supposed to return on a private message topic with a group added to it, but my suspicion is that it doesn’t include the list of users who exist as part of the group.

I’ve tagged this as a bug, but this may well be intended behaviour?

---

_[View the full topic](https://meta.discourse.org/t/group-private-message-message-bus-issue/181009)._
