Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikelle committed Dec 9, 2024
1 parent c900aaf commit 7cc5d6c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 13 additions & 1 deletion cl/member/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,19 @@ func TestMemberClientRun(t *testing.T) {
relayerServer := &fakeRelayerServer{}
pb.RegisterRelayerServer(s, relayerServer)

go s.Serve(lis)
errChan := make(chan error, 1)
go func() {
errChan <- s.Serve(lis)
}()

select {
case err := <-errChan:
if err != nil {
t.Fatalf("failed to serve: %v", err)
}
case <-time.After(time.Millisecond * 100):
// Server started successfully
}

clientID := "test-client-id"
relayerAddr := lis.Addr().String()
Expand Down
5 changes: 4 additions & 1 deletion cl/relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ func (r *Relayer) handleBidirectionalStream(stream pb.Relayer_SubscribeServer, c
if !ok || !okPayload || !okSenderID {
r.logger.Error("Invalid message format", "clientID", clientID)
// Acknowledge malformed messages to prevent reprocessing
r.ackMessage(ctx, field.ID, groupName)
err = r.ackMessage(ctx, field.ID, groupName)
if err != nil {
r.logger.Error("Failed to acknowledge malformed message", "clientID", clientID, "error", err)
}
pendingMessageID = ""
continue
}
Expand Down

0 comments on commit 7cc5d6c

Please sign in to comment.