Skip to content

Does Cup keep playing and saving the listening position through a long locked listen on a physical iPad? #375

Open

Description

@patricktree

Question

On the operator's iPad Air (2022) with the latest iPadOS, does Cup keep playing a narration track and saving the listening position through a long locked listen? Do the lock-screen controls and a headphone disconnect behave as CUP-81's acceptance criteria require?

The agent prepares a debug build and a precise checklist; the operator runs it on the device. Cover:

  • Locked playback of a track of at least 60 minutes, past its end
  • Whether position saves sent through CapacitorHttp reach the server while locked (server logs)
  • Lock-screen title, artwork, duration, position, scrubbing, play and pause
  • Unplugging or disconnecting headphones
  • A phone or FaceTime call during playback

Variant: remove UIBackgroundModes audio to see whether it is required. This is the WebView research's device experiment 1 on iPadOS, narrowed by what How does Cup's WebView audio behave on the iOS simulator? already showed.

Activity

  1. patricktree commented on Nov 14, 2026

    @patricktree
    CollaboratorAuthor

    Narrowed by How does Cup's WebView audio behave on the iOS simulator? (doc). Left for the iPad:

    • A locked listen of at least 60 minutes over the real network, playing past what was buffered before locking.
    • Whether position saves keep reaching the server while locked, and when they stop; log stream filtered to runningboardd and audio.cup.app shows Cup's real process states. On the simulator RunningBoard marked Cup's app, page and network processes suspended about 30 s after locking but ignored it only because the process is simulated.
    • Lock-screen artwork, Control Center's Now Playing, and scrubbing with WebKit's defaults.
    • Headphones disconnecting, a phone or FaceTime call, and another app starting playback.
    • The variant without UIBackgroundModes audio.

    No need to re-check title, duration, position, Play/Pause and skips, the navigator.mediaSession handlers and setPositionState, or the 206 range responses, unless iPadOS behaves differently from iOS 27.2.

  2. self-assigned this
    on Nov 14, 2026
  3. patricktree commented on Nov 14, 2026

    @patricktree
    CollaboratorAuthor

    iPad probe checklist

    For Does Cup keep playing and saving the listening position through a long locked listen on a physical iPad?. It covers only what How does Cup's WebView audio behave on the iOS simulator? could not show. Plan for about 90 minutes, most of it waiting with the iPad locked.

    Builds

    Both are debug builds of origin/main at 08b3d00d, including CUP-71's quiet retry of a failed save. They talk to production https://cup.audio and are signed for team 4GQ2V3WJW8. They sit next to this file, in the git-ignored apps/mobile-app/ios/App/build/ipad-probe-375/ of the linear-integration-e5fbe3 worktree:

    • default/App.app: the shell as it is, with UIBackgroundModes audio.
    • no-background-audio/App.app: the same build without UIBackgroundModes, for run C only.

    Cup saves the listening position at most every 5 seconds while the <audio> element fires timeupdate. So the PUT …/position requests in Workers Logs show whether page JavaScript and CapacitorHttp are still running. The narration track's GET …/narration-track.mp3 range requests show whether loading continues past the buffer.

    Prepare

    1. On the iPad, turn on Developer Mode (Settings > Privacy & Security > Developer Mode) and restart if asked. Connect it to the Mac by USB and trust the Mac.

    2. Find its name with xcrun devicectl list devices, then install the default build:

      xcrun devicectl device install app --device "<iPad name>" /Users/pkerschbaum/.claude/pkerschbaum-worktrees/cup/linear-integration-e5fbe3/apps/mobile-app/ios/App/build/ipad-probe-375/default/App.app

      If the install fails because the iPad is not in the provisioning profile, tell me while the iPad is connected, and I'll rebuild so Xcode registers it.

    3. Open Cup, sign in, and choose an audiobook whose narration track is at least 60 minutes long, or convert one. Start it from the beginning so the listen goes well past what the WebView buffers.

    4. Unplug the iPad from the Mac and use Wi-Fi only. Note the clock time as T0.

    Run A: locked listen with the default build

    1. Press Play, then lock the iPad with the top button. Leave it untouched, without waking the screen, until the track has ended, or for 65 minutes.
    2. Listen now and then without touching the iPad. Note the time if the audio stops before the end.
    3. After the end, wake the screen without unlocking. Note what the lock screen shows: title, artwork (shown, grey placeholder or none) and elapsed time.
    4. Unlock and open Cup. Note the position the player shows, and any message about a position that could not be saved. Note the time as T1.

    Run B: controls and interruptions with the default build (about 10 minutes)

    1. Lock screen: play, then lock. Check Pause, Play, skip back 10 s, skip forward 10 s, and dragging the scrubber to a new point. Note what each one does.
    2. Control Center (swipe down from the top right): does the Now Playing tile show title and artwork? Does Play/Pause work?
    3. Headphones: play through headphones, then unplug them or disconnect them in Bluetooth. Does Cup pause?
    4. Call: during playback, take a FaceTime audio call from another device. Does Cup pause? Does it resume after hanging up?
    5. Another app: during playback, start something in Music or Podcasts. Does Cup pause? Does it resume after you stop the other app? Resuming is not required; just note it.

    Run C: without background audio (about 5 minutes)

    1. Install no-background-audio/App.app with the command from step 2, but with no-background-audio in place of default. It replaces Cup and keeps your sign-in. Play, lock, and note whether and when the audio stops within 3 minutes.
    2. Reinstall default/App.app. Note the time as T2.

    Collect

    1. Connect the iPad by USB, unlocked, and collect its logs from T0:

      sudo log collect --device-name "<iPad name>" --start "<T0 as YYYY-MM-DD HH:MM:SS>" --output ~/Desktop/cup-ipad-375.logarchive --predicate 'process == "runningboardd" OR process == "App" OR process BEGINSWITH "com.apple.WebKit" OR process == "mediaserverd" OR process == "audiomxd"'
    2. In the Cloudflare dashboard, open Workers & Pages > create-audiobook-from-url > Logs. Set the timeframe from T0 to T2 and look at two filters, one after the other: URL contains /position, and URL contains narration-track.mp3. Export the events as JSON, or note the times and statuses. The Worker's development token can't tail or query production logs, so I can't read them myself.

    3. Send me your notes from steps 6 to 15, the times T0, T1 and T2, the logarchive's path and the Workers Logs export. I'll analyze them, write the research doc and resolve the ticket.

    What the results decide

    • Saves keep arriving about every 5 s through the locked hour: iOS needs no native code for saves.
    • Saves stop about 30 s after locking while audio plays: iOS suspends Cup's process, as the simulator's process manager logged. Then the locked listen saves nothing until Cup is opened again, and the engine decision has to weigh that.
    • Track requests stop with saves: audio would end when the buffer runs out. That would be the case to check in step 6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions