Skip to content

Commit 95f56e6

Browse files
fix logic issue added recently
1 parent 41a4317 commit 95f56e6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

channels/reliable_channel.nim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ proc pruneCompletedChannelReqs(self: ReliableChannel) =
137137
## segment doesn't trigger a drop on its own — we wait until siblings
138138
## are also accounted for, so the channel-level outcome is decided
139139
## from a complete picture.
140-
self.pendingMessagingRequests.keepItIf(not it.segmentSendState.isFinal())
140+
var channelsWithPending = initHashSet[RequestId]()
141+
for entry in self.pendingMessagingRequests:
142+
if not entry.segmentSendState.isFinal():
143+
channelsWithPending.incl(entry.channelReqId)
144+
self.pendingMessagingRequests.keepItIf(it.channelReqId in channelsWithPending)
141145

142146
proc onMessageSent(self: ReliableChannel, messagingReqId: RequestId) =
143147
## Invoked from this channel's `MessageSentEvent` listener. Flips

0 commit comments

Comments
 (0)