Skip to content

test(mobile): guard playback when downloads finish - #435

Merged
chhoumann merged 2 commits into
masterfrom
fix/android-download-swap
Oct 13, 2026
Merged

chhoumann merged 2 commits into
masterfrom
fix/android-download-swap

Conversation

@chhoumann

@chhoumann chhoumann commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #389. The production fix is already in #401: a download no longer replaces the source of the playing episode. This PR adds regression coverage only.

mobile:download now requires active playback and checks the same media element, unchanged source, no media errors or backward jumps, and at least two seconds of playback after download registration. The existing desktop offline journey also checks stream continuity and playback from the downloaded file after restart.

Verification

  • Android 14 emulator, Obsidian 1.14.4, same vault and sequence on the official 2.21.1 bundle and master edb9447. Downloaded Lex Fridman #501, DHH, 249,955,445 bytes, while playing from 60 seconds. Released exited 2: empty source, media error 4, position reset from 232.59 seconds to zero. Master exited 0: source unchanged, no errors or resets, playback advanced from 198.28 to 200.28 seconds after registration. Both app and renderer survived.
  • Linux desktop Obsidian 1.14.4, isolated vault, two identical 60-second WAV fixtures at http://podnotes.test:33453/feed.xml. Released also reset to zero with error 4. Master kept its stream and advanced. Android and desktop both played the downloaded file on the next load while offline.
  • Passed npm run lint, npm run format:check, npm run typecheck, npm run build, npm run test (1,740 tests), npm run test:tooling (10 tests), npm run docs:build (18 pages), npm run size, and npm run test:e2e (77 tests). After review changes, static checks and npm run test:e2e -- -t J-EDGE-03 passed again (2 tests), as did the final Android comparison. Node 22.23.2 throughout.

State dumps, log excerpts, exact reproduction steps, checks and review decisions. Released before download / master before download. Android offline playback. Desktop after download: released / master.

Released 2.21.1 after download Master edb9447 after download
Released player shows a media error and time zero Master keeps playing after the download

The Android emulator and isolated desktop instance are stopped. iOS was not tested.

Release impact

None. No production or schema changes. The bundle is byte-identical to master: 285,622 raw bytes and 90,884 gzip bytes, both deltas zero.

Docs at release

Update docs/src/content/docs/local_files.md and docs/src/content/docs/mobile.md to state that completing the playing episode's download preserves its stream and playback position; the next load uses the downloaded file. Published documentation remains unchanged in this PR.

Note

Test that downloads don't interrupt actively playing episodes

  • Updates the mobile download probe to require a remote, unregistered episode that is currently playing, and to keep playback running across the download command. It now fails when the download changes the media source, replaces the media element, emits a media error, pauses, moves playback backward, or stops advancing two seconds after registration. See podnotes-download.js
  • Updates the J-EDGE-03 resilience journey to download the episode while it streams, then verify the source and playback position survive registration and a restart. See journey-resilience.test.ts
  • Aligns the mobile verification docs with the new procedure and references issue Android: player shows a media error right after the playing episode finishes downloading #389. See mobile.md

Macroscope summarized 30cd481.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Deploying podnotes with  Cloudflare Pages  Cloudflare Pages

Latest commit: 30cd481
Status: ✅  Deploy successful!
Preview URL: https://20b95bde.podnotes.pages.dev
Branch Preview URL: https://fix-android-download-swap.podnotes.pages.dev

View logs

@chhoumann
chhoumann merged commit 6ebf835 into master Oct 13, 2026
14 checks passed
@chhoumann
chhoumann deleted the fix/android-download-swap branch October 13, 2026 02:48
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.

Android: player shows a media error right after the playing episode finishes downloading

1 participant