Skip to content

feat(kt): end a broadcast with end() - #4259

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/kotlin-end
Sep 27, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/kotlin-end

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

remove on dev (#4152) drops the deprecated finish(). Kotlin excluded moq-ffi's close() because it collides with AutoCloseable.close(), so once finish() is gone Kotlin has no way to end a broadcast while a dynamic() handle keeps it alive.

Approach

  • rs/moq-ffi/uniffi.toml renames MoqBroadcastProducer.close to end for Kotlin only, replacing the exclusion. Every other binding keeps close(), and Kotlin's close() still only releases the handle.
  • Smoke test: end() ends the broadcast (subscribe and publishTrack fail) while a dynamic() handle is held, and a second end() is a no-op.
  • KDoc on Moq.createBroadcast / Server.createBroadcast and doc/lib/kt describe end() vs close(). Also fixes a garbled Server.createBroadcast KDoc that still claimed the broadcast is announced on creation.
  • Deletes quest/m1/kotlin-end.md and its references, unblocking quest/m1/broadcast-remove.md.

Impact

  • Kotlin: new MoqBroadcastProducer.end() (alias BroadcastProducer). Additive; the generated close() was never published for Kotlin.
  • No wire change. No change to other bindings.

Alternatives

  • A hand-written end() extension in kt/moq over an excluded method: impossible, since the excluded FFI method is not generated at all.
  • Naming it shutdown() like MoqSession: end() matches the quest and reads as the broadcast ending, not the handle.

Follow-ups

  • None.

(Written by Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 2 commits September 26, 2026 10:03
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review September 26, 2026 17:18
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a5995286-8a88-4d5a-b385-33b54c40cbd9

📥 Commits

Reviewing files that changed from the base of the PR and between 2eab1c3 and 7ec6652.

📒 Files selected for processing (8)
  • doc/lib/kt/index.md
  • kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/Moq.kt
  • kt/moq/src/jvmAndAndroidMain/kotlin/dev/moq/Server.kt
  • kt/moq/src/jvmAndAndroidTest/kotlin/dev/moq/SmokeTest.kt
  • quest/m1/README.md
  • quest/m1/broadcast-remove.md
  • quest/m1/kotlin-end.md
  • rs/moq-ffi/uniffi.toml
💤 Files with no reviewable changes (3)
  • quest/m1/README.md
  • quest/m1/kotlin-end.md
  • quest/m1/broadcast-remove.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.


Walkthrough

The Kotlin binding now generates the broadcast producer method as end. A smoke test checks that ending a broadcast works while a dynamic handle remains open, that a second call is allowed, and that later track subscription and publication fail. The Kotlin documentation now describes end(), handle release, and broadcast announcement. The Kotlin end quest and its references were removed.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 7ec66

No merge-blocking risk remains in the reviewed Kotlin broadcast lifecycle change.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 7ec66

The new operation is available to callers that already hold a broadcast producer. The reviewed implementation ends that broadcast without creating a new way to reach or control other broadcasts. No security concern was established, though the generated binding and some failure paths were not independently verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The added termination authority is scoped to a caller holding the relevant Kotlin producer handle. The reviewed changes do not add a remote entrypoint or a way to acquire another producer's handle.

Trust Boundaries and Controls

  • observed — Server.createBroadcast requires its configured publish origin and delegates creation to it. The changed documentation does not change that delegation or announce the broadcast at creation.

Resilience and Maintainability Implications

  • observed — The underlying close transition rejects unserved requests and prevents later announcement; an already-claimed dynamic request remains its handler's responsibility. This is an existing boundary on what immediate termination guarantees.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding Kotlin support to end a broadcast with end().
Description check ✅ Passed The description accurately explains the problem, implementation, tests, documentation updates, and impact of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T02:05:35.313010Z 7ec6652 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merged main in to resolve a quest/m1/README.md conflict (kept main's new Error messages entry, dropped the deleted Kotlin end entry). Additive on main: Kotlin gains end(), which matches the close() that py/swift/go/dart already expose on the same FFI method. just check passes locally; Codex had no findings.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit c17b8e0 into main Sep 27, 2026
19 checks passed
@kixelated
kixelated deleted the quest/m1/kotlin-end branch September 27, 2026 02:45
This was referenced Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant