diff --git a/pkg/mls/api/v1/service.go b/pkg/mls/api/v1/service.go index 426f229c..de6cd901 100644 --- a/pkg/mls/api/v1/service.go +++ b/pkg/mls/api/v1/service.go @@ -280,6 +280,7 @@ func (s *Service) SendGroupMessages(ctx context.Context, req *mlsv1.SendGroupMes Timestamp: msg.CreatedAt.UnixNano(), Payload: msgB, }) + if err != nil { return nil, err } @@ -340,7 +341,7 @@ func (s *Service) QueryWelcomeMessages(ctx context.Context, req *mlsv1.QueryWelc func (s *Service) SubscribeGroupMessages(req *mlsv1.SubscribeGroupMessagesRequest, stream mlsv1.MlsApi_SubscribeGroupMessagesServer) error { log := s.log.Named("subscribe-group-messages").With(zap.Int("filters", len(req.Filters))) - + log.Info("subscription started") // Send a header (any header) to fix an issue with Tonic based GRPC clients. // See: https://github.com/xmtp/libxmtp/pull/58 _ = stream.SendHeader(metadata.Pairs("subscribed", "true")) @@ -349,6 +350,7 @@ func (s *Service) SubscribeGroupMessages(req *mlsv1.SubscribeGroupMessagesReques for _, filter := range req.Filters { natsSubject := buildNatsSubjectForGroupMessages(filter.GroupId) sub, err := s.nc.Subscribe(natsSubject, func(natsMsg *nats.Msg) { + log.Info("received message from nats") var msg mlsv1.GroupMessage err := pb.Unmarshal(natsMsg.Data, &msg) if err != nil { @@ -383,7 +385,7 @@ func (s *Service) SubscribeGroupMessages(req *mlsv1.SubscribeGroupMessagesReques func (s *Service) SubscribeWelcomeMessages(req *mlsv1.SubscribeWelcomeMessagesRequest, stream mlsv1.MlsApi_SubscribeWelcomeMessagesServer) error { log := s.log.Named("subscribe-welcome-messages").With(zap.Int("filters", len(req.Filters))) - + log.Info("subscription started") // Send a header (any header) to fix an issue with Tonic based GRPC clients. // See: https://github.com/xmtp/libxmtp/pull/58 _ = stream.SendHeader(metadata.Pairs("subscribed", "true")) @@ -392,6 +394,7 @@ func (s *Service) SubscribeWelcomeMessages(req *mlsv1.SubscribeWelcomeMessagesRe for _, filter := range req.Filters { natsSubject := buildNatsSubjectForWelcomeMessages(filter.InstallationKey) sub, err := s.nc.Subscribe(natsSubject, func(natsMsg *nats.Msg) { + log.Info("received message from nats") var msg mlsv1.WelcomeMessage err := pb.Unmarshal(natsMsg.Data, &msg) if err != nil {