Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Expo / React Native player for iOS and Android, with its own `package.json`,
- **`ios/` and `android/` are generated** (Continuous Native Generation, gitignored). Change `app.json`, `plugins/` or `assets/`, never the native folders.
- **iOS uses the UIScene life cycle (`expo-build-properties` `ios.enableSceneSupport`).** Without it an iOS 27-SDK build is killed at launch on iOS 27; drop it with the SDK 58 upgrade, whose template does the same (TESTING.md).
- **OTA cannot reach native code.** The Live Activity card (Lock Screen, Dynamic Island, the Apple Watch Smart Stack) is SwiftUI under `targets/live-activity/` and `modules/live-activity/ios/`, so a change there ships only in a new binary, like a dependency, `patches/`, plugin or native `app.json` change; the JS that drives it (`src/hooks/useLiveActivity.ts`) is OTA-able. The same holds for the App Intents (Siri, Shortcuts): Swift under `targets/live-activity/_shared/` and `modules/app-intents/ios/`, JS under `src/intents/`. `SubwaveLiveAttributes.swift` is compiled into both and must stay byte-identical (`npm test` checks): a mismatch stops the card rendering instead of failing the build.
- **Android Auto's browse session is RNTP's own**, reached through the patch's `MediaBrowserBridge`; `modules/android-auto` only lists stations, and a pick reaches `service.ts` as `remote-play-id`. Play enforced against a TTS-reading app once (#477); TESTING.md has the history and the device check.
- **Android Auto is off unless `SUBWAVE_ANDROID_AUTO=1` is set at prebuild** (`plugins/withAndroidAuto.js`), because Play enforced against a TTS-reading app once (#477): unset, the merged manifest declares no Android Auto support (`npm test` checks), and `docs/RELEASE.md` has the closed-testing-first plan. Its browse session is RNTP's own, reached through the patch's `MediaBrowserBridge`; `modules/android-auto` only lists stations, a pick reaches `service.ts` as `remote-play-id`, and a failed one shows the car why through the bridge's `showError` (`src/intents/car-errors.ts`), sending the driver to the phone only "when it's safe". TESTING.md has the history and the device check.
- **The CarPlay app is off unless `SUBWAVE_CARPLAY=1` is set at prebuild** (`plugins/withCarPlay.js`), because a device build can't be signed with the CarPlay entitlement until Apple grants it. Unset, the Info.plist and entitlements are unchanged (`npm test` checks). Its Swift is `targets/live-activity/_shared/SubwaveCarPlay.swift` (TESTING.md).
- **The station password is not the station login** (#478). Every check is the fail-closed `POST /station-auth`, and only the controller's own answers count: a 200 with its `{ ok: true }` body is a right password and a 401 with its `{ ok: false }` body a wrong one, while anything else keeps a saved password and saves no typed one (`stationAuthResult`, #2143, #2164); the password rides the stream as `?auth=` so Cast works; `createApi` reads it through a getter because the feed reset and the Live Activity lifecycle key on the `api` object's identity, so rebuilding the client on unlock would reset both. While playback is stuck, `src/lib/stuck-password-check.ts` asks again after every answer but a denial, never within 120 s of the last check or before a 429's `Retry-After` runs out, capped at the route's own window: it allows a household's address 20 attempts per 15 minutes (#2141, #2164). When the gate's stop takes a tuned-in listener off the air, the right typed password tunes them back in with no second press (`src/lib/gate-resume.ts`, the twin of the web's `lib/gateResume.ts`), through `tune`, so it is a listener's own load in `stream-recovery.ts`. `useStationGate` outlives a station switch, so the hold names the `api` it was taken on, and `tune` toggles, so it never runs for a listener already tuned in.
- **Every stream reload goes through `src/lib/stream-recovery.ts` while the player is mounted** (#2114, #2139): one at a time, and never on a state event alone. A listener's own load (a tune-in, a retune, a Play from the lock screen, a headset, CarPlay or Bluetooth) always loads, queued behind one in flight. `service.ts` hands a remote Play to the mounted player (`src/lib/remote-play.ts`) and loads directly only when none is mounted, which Android's headless service allows; an App Intent's tune-in and station switch do the same (`src/intents/tune-flow.ts`), and so does an Android Auto pick. The watchdog, churn guard and error backoff each check the native media clock first, because a reload re-sends Icecast's burst and the listener hears audio twice; a regained link reads it through the pending check it brings forward, and with none pending reloads at once. Every load is checked even when it reports no state (iOS drops a repeated Loading, #2143), and an automatic reload is a failure until its item stays up, so a hung station backs off to 60 s. Playing resets that only provisionally: an item that fails after stopping within 4 s of its first Playing, judged from the moment it stopped, takes the reset back, and the reload after it waits at most 16 s, so a stream cut a moment in can't reload 35-60 times a minute. A stall never counts, however early, and stays on the 6 s watchdog: Icecast closes a stalled socket about 15 s after its source stops, so a longer wait hears that close as a failure, and a flapping source climbs to a minute of silence. A hold counts as the item's Playing, because JS can miss the real one. None of this runs during an iOS audio interruption (a call, Siri), which freezes the clock without a state event.
Expand Down
1 change: 1 addition & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
}
],
"./plugins/withAndroidUserCaTrust",
"./plugins/withAndroidAuto",
"./plugins/withGradleMemory",
[
"expo-secure-store",
Expand Down
66 changes: 65 additions & 1 deletion docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ a branch at update time.
|---|---|---|---|
| `development` / `development-device` | — | dev client | local Metro, no OTA |
| `preview` | `preview` | internal (Android APK, iOS non-sim) | tester builds; OTA test bed |
| `production` | `production` | store builds (Android AAB, iOS) | App Store / Play |
| `production` | `production` | store builds (Android AAB, iOS) | App Store / Play, **no Android Auto** |
| `production-auto` | `production` | Android AAB with `SUBWAVE_ANDROID_AUTO=1` | Play **closed testing** with Android Auto (below) |
| `apk` | `production` | Android APK with `SUBWAVE_ANDROID_AUTO=1` | the sideloaded build with Android Auto (below) |

`cli.appVersionSource = "remote"`, so build/version numbers live on EAS
(`production` auto-increments). Don't hand-edit `ios.buildNumber` /
Expand Down Expand Up @@ -135,12 +137,74 @@ eas build --profile production --platform android # AAB (EAS-managed keystore
eas submit --profile production --platform android # uses secrets/play-service-account.json
```

For the Android Auto build, see [Android Auto](#android-auto-closed-testing-first)
below: `production-auto` builds it and submits it to closed testing.

`eas submit` Android config (`eas.json` → `submit.production.android`) points at
`secrets/play-service-account.json` (gitignored). Data-safety form answers:
[`docs/store/PLAY-DATA-SAFETY.md`](./store/PLAY-DATA-SAFETY.md). Full flow +
Play Console checklist: `subwave-app-android-release` skill and
`PRODUCTION-READINESS.md` Phase D.

### Android Auto: closed testing first

Android Auto is behind `SUBWAVE_ANDROID_AUTO=1` at prebuild
(`plugins/withAndroidAuto.js`, TESTING.md → Android Auto). Play enforced against
the app's first car listing (#477, 20 Jun 2026): *media apps that use a TTS
engine to read out content aren't permitted*. A browse tree doesn't change
that, so whether the car listing survives a second review is a **decision, not
code**. The plan:

1. **Play Console, once:** Advanced settings → Form factors → Add form factor →
**Android Auto**, and opt in. A bundle that declares
`com.google.android.gms.car.application` goes through Google's extra manual
car review.
2. **Closed testing with Android Auto:**

```bash
eas build --profile production-auto --platform android
eas submit --profile production-auto --platform android # track "alpha" = closed testing, as a draft
```

Why closed testing (`alpha`) and not `internal`: Google's car review is
*none* on internal testing, *non-blocking* on closed testing and
*blocking* on open testing and production
(developer.android.com/training/cars/distribute). Internal would never tell
us whether the listing passes; closed testing gets the verdict without
holding the build back. The release lands as a draft, so a person sends it
for review in Play Console.
3. **Review notes** (Play Console → the release / App access): say plainly
that the DJ voice is generated on the station's server and mixed into the
Icecast audio stream with the music, like a broadcast radio presenter; **the
app runs no TTS engine and reads no text aloud**, it plays one live audio
stream. Give the reviewer a station to play: the featured SUB/WAVE station
(`extra.featuredStation`, offered in onboarding) or a test station's address
and password, and say a station must be added on the phone once, after which
the car lists it.
4. **If the car review passes**, promote the same build towards production
(`production-auto` stays the Play profile from then on).
5. **If it is rejected**, ship Play with the flag off:
`eas build --profile production --platform android` and the usual `eas submit
--profile production`, same JS, no car listing. Don't argue the build past
the policy with a variant that hides the DJ.
6. **Separately, either way: the sideloaded APK.** `eas build --profile apk
--platform android` builds a release APK with Android Auto on. Publish it on
GitHub Releases and the website, by hand (nothing here uploads it), with
these notes for listeners:
- Android Auto lists only apps installed from Play unless developer mode
allows others: in Android Auto's settings tap *Version and permission
info* 10 times, then ⋮ → **Developer settings** → turn on **Unknown
sources**. Without that, SUB/WAVE doesn't appear in the car.
- The APK is signed with the upload key and Play's copy with Play's app
signing key, so one can't update the other: uninstall the Play version
before installing the APK, and the other way round.

OTA updates reach all three Android builds alike: the flag changes only the
generated manifest, not the fingerprint's inputs (`npx expo-updates
fingerprint:generate --platform android` gives the same hash with and
without it), so the `production` channel serves `production`, `production-auto`
and `apk` binaries from one `eas update`.

---

## Pre-release gate
Expand Down
Loading
Loading