fix(gpodder): speak the protocol AntennaPod actually sends #192

Merged
midas merged 1 commit from claude/app-opod-sync-analysis-0d1825 into main 2026-12-01 12:04:29 +01:00
Owner

Why

Goal: let PodRadar replace oPodSync. Comparing the sync endpoints with the AntennaPod source (develop) showed that AntennaPod could not set up or sync against PodRadar at all. The existing tests passed because they encoded a contract no client uses.

What changes

AntennaPod sends Before Now
POST /api/2/auth/{user}/login.json only PUT mapped POST, creates a session
Basic auth on login only, session cookie afterwards stateless chain, no cookie, so 401 on everything after login cookie accepted; Basic per request still works
GET /api/2/devices/{user}.json, POST /api/2/devices/{user}/{device}.json during setup missing added
GET subscriptions/...?since= expecting {add, remove, timestamp} bare list, since ignored real delta
timestamps without zone (2026-07-26T10:00:00) parse failure, replaced by receive time read as UTC

Notes:

  • With since=0 no removals are reported, so a freshly connected device never unsubscribes anything.
  • The PUT login mapping is removed; no known client uses it.

Verification

Not run locally: the machine this was written on has no Maven and only JDK 21 (the project needs 25). CI on this PR is the first time the code is compiled and tested.

Tests added/updated:

  • Phase1IntegrationTest: new test replaying the full AntennaPod setup and sync sequence with the cookie only; existing tests moved to the real contract.
  • GpodderServiceTest: subscription delta (adds, removes, re-added feeds, since=0).
  • GpodderDeviceIdorTest: follows the new response shape.

Main risk to watch in CI: the session behaviour of the /api/2/** chain (Basic auth alone must not create a session; the cookie from login.json must authenticate later requests).

Not in this PR

  • Live sync uploads still do not update the per-episode play state shown in the UI.
  • No Nextcloud gpoddersync API.

🤖 Generated with Claude Code

## Why Goal: let PodRadar replace oPodSync. Comparing the sync endpoints with the AntennaPod source (`develop`) showed that AntennaPod could not set up or sync against PodRadar at all. The existing tests passed because they encoded a contract no client uses. ## What changes | AntennaPod sends | Before | Now | |---|---|---| | `POST /api/2/auth/{user}/login.json` | only `PUT` mapped | `POST`, creates a session | | Basic auth on login only, session cookie afterwards | stateless chain, no cookie, so 401 on everything after login | cookie accepted; Basic per request still works | | `GET /api/2/devices/{user}.json`, `POST /api/2/devices/{user}/{device}.json` during setup | missing | added | | `GET subscriptions/...?since=` expecting `{add, remove, timestamp}` | bare list, `since` ignored | real delta | | timestamps without zone (`2026-07-26T10:00:00`) | parse failure, replaced by receive time | read as UTC | Notes: - With `since=0` no removals are reported, so a freshly connected device never unsubscribes anything. - The `PUT` login mapping is removed; no known client uses it. ## Verification **Not run locally**: the machine this was written on has no Maven and only JDK 21 (the project needs 25). CI on this PR is the first time the code is compiled and tested. Tests added/updated: - `Phase1IntegrationTest`: new test replaying the full AntennaPod setup and sync sequence with the cookie only; existing tests moved to the real contract. - `GpodderServiceTest`: subscription delta (adds, removes, re-added feeds, `since=0`). - `GpodderDeviceIdorTest`: follows the new response shape. Main risk to watch in CI: the session behaviour of the `/api/2/**` chain (Basic auth alone must not create a session; the cookie from `login.json` must authenticate later requests). ## Not in this PR - Live sync uploads still do not update the per-episode play state shown in the UI. - No Nextcloud gpoddersync API. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(gpodder): speak the protocol AntennaPod actually sends
All checks were successful
Build and Publish / mcp (push) Successful in 10s
Build and Publish / frontend (push) Successful in 13s
Build and Publish / backend (push) Successful in 3m14s
Build and Publish / publish (push) Has been skipped
ae0522bc44
The sync endpoints were tested against a contract no client uses, so
AntennaPod could not set up or sync against PodRadar:

- login.json only accepted PUT; clients POST
- the chain was stateless, but clients send Basic credentials on login
  only and rely on the session cookie afterwards
- the device list/configure endpoints used during setup did not exist
- GET subscriptions returned a bare list and ignored `since`; clients
  expect {add, remove, timestamp}
- zone-less UTC timestamps (2026-07-26T10:00:00) failed to parse and
  were replaced by the receive time, which also defeated the dedupe

Login now creates a session, device endpoints are added, subscription
changes are a real delta, and the zone-less format is read as UTC.
Tests follow the real contract, including one that replays the full
AntennaPod setup and sync sequence using the cookie only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
midas merged commit 95a38662bf into main 2026-12-01 12:04:29 +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!192
No description provided.