• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jhheider / pdcst / 29265588594
67%

Build:
DEFAULT BRANCH: main
Ran 13 Jul 2026 04:17PM UTC
Jobs 1
Files 44
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Jul 2026 04:14PM UTC coverage: 66.47% (+1.4%) from 65.11%
29265588594

push

github

web-flow
fix: background refresh no longer erases resume position, downloads, and now-playing (#32)

The real cause of "quit mid-play loses the position / now-playing / has to
rebuffer" was not the save path - it was the refresh path. `insert_episode`
was an `INSERT OR REPLACE`, and the refresher re-inserts every parsed
episode on each (hourly + on-launch) refresh. For an episode that already
exists, REPLACE deletes the row and inserts a new one:

- user-state columns (playback_position_seconds, played, download_status,
  local_path) are reset to the parsed feed's defaults - wiping the resume
  point and making downloaded episodes look un-downloaded (re-stream), and
- `Episode::new` mints a fresh id each parse, so the delete trips the
  playback_state `ON DELETE SET NULL` and the queue FKs - nulling the
  now-playing episode and dropping queued items.

Ground truth from the live DB confirmed it: 6604 episodes, zero with a
nonzero position, and playback_state.current_episode_id NULL with a live
position. Fix: make `insert_episode` a metadata-only upsert
(`ON CONFLICT(subscription_id, guid) DO UPDATE SET <feed fields>`) that
never deletes and never touches user-state; downloads/position/played are
persisted by their own dedicated UPDATEs.

Also, per the ask, throttle the position checkpoint to
`save_position_interval_seconds` (default 10, previously unused) instead of
every 1s tick - pause/stop/quit still save immediately, so this only bounds
the crash-loss window while cutting DB churn ~10x.

Test: refresh_reinsert_preserves_user_state_and_identity asserts a
same-guid/fresh-id re-insert keeps the id, position, played, download, and
the now-playing FK, while refreshing feed metadata. Would fail under the
old REPLACE.


Claude-Session: https://claude.ai/code/session_014meUZPwNWx1cfEub4Ncx3Y

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

10 of 24 new or added lines in 4 files covered. (41.67%)

419 existing lines in 11 files now uncovered.

3826 of 5756 relevant lines covered (66.47%)

2618928.43 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
17.56
-0.68% crates/pdcst/src/app/state/playback.rs
2
0.0
0.0% crates/pdcst/src/app/update.rs

Coverage Regressions

Lines Coverage ∆ File
86
17.56
-0.68% crates/pdcst/src/app/state/playback.rs
71
0.0
0.0% crates/pdcst/src/app/mod.rs
57
0.0
0.0% crates/pdcst/src/app/update.rs
54
71.71
0.83% crates/pdcst/src/audio/player/mod.rs
46
83.68
0.47% crates/pdcst/src/ui/mod.rs
26
75.13
0.27% crates/pdcst/src/app/state/mod.rs
25
71.59
61.59% crates/pdcst/src/config.rs
22
0.0
0.0% crates/pdcst/src/main.rs
18
91.95
0.59% crates/pdcst/src/audio/stream.rs
11
90.3
16.45% crates/pdcst/src/feed/parser.rs
3
96.1
0.0% crates/pdcst/src/app/events.rs
Jobs
ID Job ID Ran Files Coverage
1 29265588594.1 13 Jul 2026 04:17PM UTC 44
66.47
GitHub Action Run
Source Files on build 29265588594
  • Tree
  • List 44
  • Changed 14
  • Source Changed 14
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29265588594
  • 7e5f466d on github
  • Prev Build on main (#29222808083)
  • Next Build on main (#29266263278)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc