feat(ios): ios audio setEngineAvailability support - #53
Conversation
📝 WalkthroughWalkthroughThe iOS audio device module now exposes engine availability control and inspection, adds default and disabled availability presets, updates related TODO documentation, and advances the package and StreamWebRTC dependency versions. ChangesAudio engine availability API
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ios/RCTWebRTC/Utils/AudioDeviceModule/AudioDeviceModule.swift`:
- Around line 363-370: Expose engine availability through the React Native
bridge: add matching audioDeviceModule get/set exports in
WebRTCModule+RTCAudioDeviceModule.m, implement corresponding methods in
AudioDeviceModule.ts returning { isInputAvailable, isOutputAvailable }, and
remove the stale unsupported-method TODO while preserving the Swift wrapper
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ae77ce7f-854c-4d8f-ba68-a990c64e5f1b
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
ios/RCTWebRTC/Utils/AudioDeviceModule/AudioDeviceModule.swiftios/RCTWebRTC/Utils/AudioDeviceModule/RTCAudioDeviceModuleControlling.swiftios/RCTWebRTC/WebRTCModule+RTCAudioDeviceModule.mpackage.jsonstream-react-native-webrtc.podspec
💤 Files with no reviewable changes (1)
- ios/RCTWebRTC/WebRTCModule+RTCAudioDeviceModule.m
…shing) (#46) ## What Adds an automated, `workflow_dispatch`-triggered release for `@stream-io/react-native-webrtc`, modeled on [`stream-chat-js`'s `release.yml`](https://github.com/GetStream/stream-chat-js/blob/master/.github/workflows/release.yml). Uses **semantic-release** for version computation, changelog, git tag, and GitHub Release, and publishes to npm via **tokenless Trusted Publishing (OIDC)** with automatic provenance. Replaces the manual flow (`tools/release.sh` + hand-run `npm publish`). ## Files | File | Purpose | |------|---------| | `.github/workflows/release.yml` | Dispatch release job: `dry_run` input, OIDC + issue/PR token scopes, concurrency group, branch safety guard, `npx semantic-release` | | `.github/actions/setup-node/action.yml` | Composite action — Node from `.nvmrc` (v24) + `npm ci` | | `.releaserc.json` | semantic-release branches + plugin pipeline (commit-analyzer → release-notes → changelog → npm → git → github) | | `.github/workflows/{ci,android_ci,ios_ci}.yml` | Adopt the composite action; bump `checkout@v6` / `setup-java@v5`; drop the now-redundant root `npm install` | | `.github/stale.yml` | Removed — config for the long-retired Probot Stale app | | `README.md` | Stream-specific rewrite of stale upstream sections + new **Releasing** section documenting the branch↔channel mapping | | `package.json` / `package-lock.json` | `semantic-release` script + 4 devDependencies, lockfile synced so `npm ci` succeeds | ## Release channels There is **no channel input** — the branch you dispatch from selects the channel, via the *"Use workflow from"* dropdown. Documented in the README's Releasing section. | Dispatch from | Version | npm dist-tag | |---|---|---| | `master` | `145.1.0` | `latest` | | `beta` | `145.1.0-beta.1` | `beta` | | `alpha` | `145.1.0-alpha.1` | `alpha` | | `<major>.x` (e.g. `145.x`) | `145.0.1` | `145.x` | | any, with `dry_run: true` | computed + printed only | — | `alpha` is included deliberately: the `alpha` dist-tag currently points at `145.1.0-alpha.1` and the 145 line has 10 published alphas, so dropping that channel would have been a regression. A branch only appears in the dispatch dropdown once it exists on the remote **and** contains `release.yml`, so `alpha` / `beta` / `<major>.x` need branching off `master` before first use. ##⚠️ Remaining prerequisite **Configure the npm Trusted Publisher** for `@stream-io/react-native-webrtc` on npmjs.com (Settings → Trusted Publisher → GitHub Actions → this repo + `release.yml`). Tokenless OIDC publish fails without it. This must happen **before any dispatch, including `dry_run: true`** — `@semantic-release/npm` runs `verifyConditions` on every invocation, so a dry run without a registered publisher falls back to looking for `NPM_TOKEN` and fails with `ENONPMTOKEN`. That failure reads like a broken release config but is only the missing registry setting. The baseline-tag concern from the original description is **resolved**: `v145.0.0` now exists on the remote and is an ancestor of `master`, and it matches semantic-release's default `v${version}` tag format. ## Verification performed On the merged tree, not just `tsc`: - `npm ci` — clean; lockfile stays `lockfileVersion: 2` with no drift - `npm run lint` (eslint + `tsc --noEmit`) — pass - `git status --porcelain` after `npm ci` — clean, so `ci.yml`'s dirty-tree gate still holds with `bob 0.43` - `npm pack --dry-run` — `lib/` present (built by `prepare` at publish time) - Config load: all 15 plugin hooks resolve; branch guard correctly refuses to publish from a feature branch - **Version computation exercised end-to-end** (`--dry-run`, `--branches` override, no publish/push): computes **145.1.0** from `feat(ios): setEngineAvailability (#53)` + the stereo `fix:`, with correctly rendered release notes - `alpha` channel resolution checked against semantic-release's own `lib/branches/normalize.js` → `channel="alpha"`, `prerelease="alpha"`, matching the existing dist-tag - `npm version --no-git-tag-version` confirmed to update all three version fields in `package-lock.json`, so no `package.json`/lock drift after a release commit (the lock is in the `git` plugin's `assets`) - Trusted publishing confirmed supported in the installed `@semantic-release/npm@13.1.5` (`lib/trusted-publishing/`); Node 24 bundles npm 11.16, above the 11.5.1 floor, so no `npm install -g npm@latest` step is needed ## Fixed during review - **`permissions` was missing `issues: write` / `pull-requests: write`.** Declaring any scope sets all undeclared scopes to `none`, and `@semantic-release/github`'s `success` step comments on / labels / closes released issues and PRs, rethrowing failures. Since `7c971e1 feat(ios): … (#53)` is in range, the first release would have published to npm, pushed the tag and release commit, created the GitHub Release — and *then* failed the job with 403s. Dry runs cannot catch this; they skip `publish`/`success` entirely. - **Added a `concurrency` group** (`cancel-in-progress: false`). Two overlapping dispatches would both compute the same version and race on the tag, the branch push, and the publish. Cancellation is deliberately disabled because the tag and release commit are pushed *before* publish, so a cancelled run can leave the repo tagged with nothing on npm. - **`GITHUB_TOKEN` now passed to the Release step** (was flagged in the original description). - **Merged `master`** — resolved conflicts in `ios_ci.yml` (kept master's Xcode-versioned Pods cache + the composite action), `package.json` (master's `bob ^0.43.0` + `semantic-release`), and regenerated `package-lock.json`. ## Known follow-ups (not addressed here) - The branch guard admits `release*` and non-numeric `*.x` names that `.releaserc.json` doesn't handle, so a dispatch from e.g. `release/145.2` produces a **green run that publishes nothing**. - `{ "scope": "deps", "release": "patch" }` constrains only the scope, so `feat(deps):` yields a patch instead of a minor. Adding `"type": "chore"` would confine it to dependabot-style commits. - `tools/release.sh` is still present alongside the new flow. - The README rewrite dropped the Picture-in-Picture section, which is Stream-authored content pointing users at `@stream-io/video-react-native-sdk` — worth restoring if the removal was unintentional. ## Lockfile note The large diff is almost entirely the reshuffling of `lockfileVersion: 2`'s legacy nested `dependencies` block. Compared structurally against `master`'s lockfile, the change is **398 packages added, 0 removed, 0 version changes** — a pure addition of semantic-release's tree. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added an automated Release workflow using semantic-release, including a dry-run option. * Enabled consistent Node provisioning in CI via a shared local setup action across Android, iOS, and general CI. * **Chores** * Added semantic-release tooling and release scripts/configuration (including changelog and package publishing). * Removed stale-issue automation configuration. * **Documentation** * Updated README to reflect the `@stream-io/react-native-webrtc` package branding and streamlined related/example project sections. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Release Updates