Skip to content

Commit 43be4d6

Browse files
Merge pull request #58 from matrix-org/addresss-refactoring-leftovers
Addresss left-overs from Dave's review
2 parents 2b0597d + afc4a84 commit 43be4d6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pkg/common/message_sink.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ type MessageSink[SenderType comparable, MessageType any] struct {
1616
// The message sink to which the messages are sent.
1717
messageSink chan<- Message[SenderType, MessageType]
1818
// Atomic variable that indicates whether the message sink is sealed.
19-
// This is used to prevent sending messages to a sealed message sink.
20-
// The variable is atomic because it may be accessed from multiple goroutines.
19+
// Basically it means that **the current sender** (but not other senders)
20+
// won't be able to send any more messages to the message sink. The difference
21+
// between this and the channel being closed is that the closed channel is not
22+
// available for writing for all senders.
2123
sealed atomic.Bool
2224
}
2325

pkg/conference/participant.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func (p *Participant) sendDataChannelMessage(toSend event.SFUMessage) {
5050
jsonToSend, err := json.Marshal(toSend)
5151
if err != nil {
5252
p.logger.Error("Failed to marshal data channel message")
53+
return
5354
}
5455

5556
if err := p.peer.SendOverDataChannel(string(jsonToSend)); err != nil {

0 commit comments

Comments
 (0)