mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-08 23:54:39 +00:00
fix(nestsClient): write Ended announce when publisher.close() races registerAnnounceBidi
When publisher.close() acquires the gate lock before registerAnnounceBidi, the announce bidi list is empty and no Ended message is sent. Fix by writing Ended + finishing the bidi in registerAnnounceBidi when publisherClosed is already true, mirroring what close() does for bidis it owns at close time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015t3bsJruGerz53yafZyp9n
This commit is contained in:
+14
@@ -1398,6 +1398,20 @@ class MoqLiteSession internal constructor(
|
||||
) {
|
||||
gate.withLock {
|
||||
if (publisherClosed) {
|
||||
// publisher.close() raced ahead — write Ended now so
|
||||
// the relay sees the proper lifecycle close on this bidi.
|
||||
runCatching {
|
||||
bidi.write(
|
||||
MoqLiteCodec.encodeAnnounce(
|
||||
MoqLiteAnnounce(
|
||||
status = MoqLiteAnnounceStatus.Ended,
|
||||
suffix = emittedSuffix,
|
||||
hops = emptyList(),
|
||||
),
|
||||
version,
|
||||
),
|
||||
)
|
||||
}
|
||||
runCatching { bidi.finish() }
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user