Skip to content

fix(swift): take container init bytes as Data - #5628

Merged
kixelated merged 1 commit into
mainfrom
fix/swift-media-data
Oct 16, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/swift-media-data

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

main fails the macOS Swift build since #5559:
Media.swift:71:76: cannot convert value of type '[UInt8]' to expected argument type 'Data' (merge-queue Platform run 38824054798).
UniFFI maps Vec<u8> to Data, but the new Media.ContainerInit wrapper stored its bytes as [UInt8].
The Swift build only runs on macOS, so Linux CI never compiled it.

Approach

Make ContainerInit.data and its initializer take Data.
This matches VideoInit, AudioFrame, and frame writes, and restores the type ContainerInit had as a MoqContainerInit typealias before #5559.
The existing data: [] test literal still compiles, since Data is array-literal expressible.

Impact

Alternatives

  • Convert at the FFI call (Data(data)): keeps [UInt8] in the public API, inconsistent with every other byte field in the Swift wrapper, for an extra copy.

Follow-ups

None. The other bindings #5559 touched (Go []byte, Python bytes, Kotlin/Dart/C++ aliases) match their generated types and are built on Linux CI.

(Written by Opus 5.5)

🤖 Generated with Claude Code

UniFFI maps Vec<u8> to Data, so the [UInt8] field from #5559 did not compile on macOS. Data also matches VideoInit and the pre-#5559 typealias.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-10-16T00:15:00.222710Z 9309e06 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a8ac7c02-e417-46f7-85d7-c8e5bc7210d4
📥 Commits

Reviewing files that changed from the base of the PR and between 290485e and 9309e06.

📒 Files selected for processing: 1
  • swift/Sources/Moq/Media.swift
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit: 9309e06.

No actionable bugs found. Both ContainerInit byte declarations now match the generated initializer's Data argument, as confirmed by the earlier macOS compiler diagnostic. Foundation is already imported; the existing data: [] test call remains compatible. This narrowly restores the byte type used before the wrapper replaced the typealias, without adding an unnecessary conversion or changing the wire format.

Verification: inspected Swift source/call sites and the existing failing macOS log (run 38824054798, job 116727301509). No tests or post-fix macOS build run by me; the head's Platform workflow was skipped.

@kixelated
kixelated added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit a85e218 Oct 16, 2026
8 of 9 checks passed
@kixelated
kixelated deleted the fix/swift-media-data branch October 16, 2026 01:14
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