From d6e91ffab3f22e16738bcfb5dd00f3e9f7dfa4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Jerman?= Date: Mon, 21 Dec 2020 20:27:44 +0100 Subject: [PATCH] Fix messaging ws/channel event parameters As members & member were not specified, the preproc step attempts to lookup the store, but the data is not yet committed. This results in partial data. --- messaging/service/channel.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/messaging/service/channel.go b/messaging/service/channel.go index 2aae5d145..c9ff3fa5b 100644 --- a/messaging/service/channel.go +++ b/messaging/service/channel.go @@ -3,6 +3,7 @@ package service import ( "context" "fmt" + "github.com/cortezaproject/corteza-server/messaging/types" "github.com/cortezaproject/corteza-server/pkg/actionlog" "github.com/cortezaproject/corteza-server/pkg/auth" @@ -349,6 +350,7 @@ func (svc *channel) Create(new *types.Channel) (ch *types.Channel, err error) { // Copy all member IDs to channel's member slice ch.Members = mm.AllMemberIDs() + ch.Member = mm.FindByUserID(chCreatorID) // Create the first message, doing this directly with repository to circumvent // message service constraints @@ -865,6 +867,9 @@ func (svc *channel) AddMember(channelID uint64, memberIDs ...uint64) (out types. svc.event.Join(memberID, channelID) out = append(out, member) + + ch.Member = member + ch.Members = out.AllMemberIDs() } // Push channel to all members