From b0bfd5fe9f4cc9e74e40d1dc488ce7c31dfc01ee Mon Sep 17 00:00:00 2001 From: Jake Taylor <jake@elixxir.io> Date: Mon, 4 Apr 2022 13:22:39 -0500 Subject: [PATCH] cleanup --- groupChat/receiveRequest.go | 2 +- groupChat/sendRequests.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/groupChat/receiveRequest.go b/groupChat/receiveRequest.go index eaacd5981..3149c1220 100644 --- a/groupChat/receiveRequest.go +++ b/groupChat/receiveRequest.go @@ -56,7 +56,7 @@ func (l *requestListener) Name() string { return catalog.GroupRq } -// readRequest returns the group describes in the group request message. An +// readRequest returns the group described in the group request message. An // error is returned if the request is of the wrong type or cannot be read. func (m *Manager) readRequest(msg receive.Message) (gs.Group, error) { // Return an error if the message is not of the right type diff --git a/groupChat/sendRequests.go b/groupChat/sendRequests.go index d5871731f..f87b53bb9 100644 --- a/groupChat/sendRequests.go +++ b/groupChat/sendRequests.go @@ -30,7 +30,7 @@ const ( // ResendRequest allows a groupChat request to be sent again. func (m Manager) ResendRequest(groupID *id.ID) ([]id.Round, RequestStatus, error) { - g, exists := m.gs.Get(groupID) + g, exists := m.GetGroup(groupID) if !exists { return nil, NotSent, errors.Errorf(resendGroupIdErr, groupID) } @@ -94,10 +94,13 @@ func (m Manager) sendRequests(g gs.Group) ([]id.Round, RequestStatus, error) { errors.Errorf(sendRequestAllErr, len(errs), strings.Join(errs, "\n")) } + // Convert roundIdMap to List + roundList := roundIdMap2List(roundIDs) + // If some sends returned an error, then return a list of round IDs for the // successful sends and a list of errors for the failed ones if len(errs) > 0 { - return roundIdMap2List(roundIDs), PartialSent, + return roundList, PartialSent, errors.Errorf(sendRequestPartialErr, len(errs), n, strings.Join(errs, "\n")) } @@ -106,7 +109,7 @@ func (m Manager) sendRequests(g gs.Group) ([]id.Round, RequestStatus, error) { len(g.Members), g.Name, g.ID) // If all sends succeeded, return a list of roundIDs - return roundIdMap2List(roundIDs), AllSent, nil + return roundList, AllSent, nil } // sendRequest sends the group request to the user via E2E. -- GitLab