fix(gpodder): update play state from live episode actions #203

Merged
midas merged 1 commit from fix/live-sync-play-state into main 2026-12-01 14:27:30 +01:00
Owner

Closes #193.

What

Episode actions uploaded through POST /api/2/episodes/{user}.json now also update episode_play_state, so listening progress in the UI keeps moving after the migration instead of freezing at that moment.

  • New PlayStateSyncService listens to EpisodeActionsUploadedEvent (which now carries the uploaded actions) after commit, in its own transaction. A failure there cannot turn a successful sync into an error for the client.
  • Only actions that say something about progress count: play with a position and new. A download or delete leaves existing progress alone.
  • State is derived with OpodsyncMigrationService.derivePlayState, the same rules as the migration import. A stored state is only replaced by a newer timestamp.
  • Existing rows are found by guid, then by episode URL (with and without trailing slash, since the import trims it).

Feed and episode URLs of new rows are stored exactly as the client sent them, so they match the subscription's feed URL.

Verification

  • New PlayStateSyncServiceTest (unit) and an integration test in Phase1IntegrationTest that uploads actions over HTTP and checks the stored state.
  • Not built locally (no JDK 25 / Maven on this machine); relies on CI.

🤖 Generated with Claude Code

Closes #193. ## What Episode actions uploaded through `POST /api/2/episodes/{user}.json` now also update `episode_play_state`, so listening progress in the UI keeps moving after the migration instead of freezing at that moment. - New `PlayStateSyncService` listens to `EpisodeActionsUploadedEvent` (which now carries the uploaded actions) after commit, in its own transaction. A failure there cannot turn a successful sync into an error for the client. - Only actions that say something about progress count: `play` with a position and `new`. A `download` or `delete` leaves existing progress alone. - State is derived with `OpodsyncMigrationService.derivePlayState`, the same rules as the migration import. A stored state is only replaced by a newer timestamp. - Existing rows are found by guid, then by episode URL (with and without trailing slash, since the import trims it). Feed and episode URLs of new rows are stored exactly as the client sent them, so they match the subscription's feed URL. ## Verification - New `PlayStateSyncServiceTest` (unit) and an integration test in `Phase1IntegrationTest` that uploads actions over HTTP and checks the stored state. - Not built locally (no JDK 25 / Maven on this machine); relies on CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(gpodder): update play state from live episode actions
All checks were successful
Build and Publish / mcp (push) Successful in 16s
Build and Publish / frontend (push) Successful in 17s
Build and Publish / backend (push) Successful in 4m59s
Build and Publish / publish (push) Has been skipped
51d80a4868
Per-episode progress in the UI comes from episode_play_state, which was only
written by the migration import and PUT /api/playstate. Actions uploaded by a
syncing client now update it too: play actions with a position and new
actions are applied with the migration's derive rules, newest timestamp wins.
It runs after the upload commits, in its own transaction, so it cannot fail
a sync.

Closes #193

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
midas merged commit 605fcd4ba0 into main 2026-12-01 14:27:30 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
midas/podradar!203
No description provided.