fix(api): MediaTokenClaim Serializable — ?st= media fetches 500ed after serving bytes #1227

Merged
chris merged 2 commits from fix/media-token-serializable into main 2026-10-14 22:20:22 +02:00
Owner

Root cause of the first live cast failure (Chromecast shows cast icon, no image): the JDBC-backed session store serializes the SecurityContext after every request; MediaTokenAuthentication carried a non-Serializable MediaTokenClaim, turning each successful token-authenticated media fetch into NotSerializableException/500 after the bytes were served. Fix: claim implements Serializable + JDK round-trip regression test. KNOWN_ISSUES ISSUE-159. Full :apps:api:test green locally.

Root cause of the first live cast failure (Chromecast shows cast icon, no image): the JDBC-backed session store serializes the SecurityContext after every request; MediaTokenAuthentication carried a non-Serializable MediaTokenClaim, turning each successful token-authenticated media fetch into NotSerializableException/500 after the bytes were served. Fix: claim implements Serializable + JDK round-trip regression test. KNOWN_ISSUES ISSUE-159. Full :apps:api:test green locally.
fix(api): make MediaTokenClaim Serializable — token-authenticated media fetches 500ed after serving bytes
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 10m26s
e557b5f32b
The JDBC-backed session store serializes the SecurityContext after every
request. MediaTokenAuthentication (AbstractAuthenticationToken, serializable)
carried a MediaTokenClaim record that was not Serializable, so every
successful ?st= token-authenticated media fetch threw
NotSerializableException while persisting the context — the client
(Chromecast Default Receiver) got a 500 and never rendered the image even
though token verification and the controller had succeeded.

Fix: claim implements Serializable (+serialVersionUID). Regression test
MediaTokenClaimSerializationTest reproduces the session-store's exact
JDK serialization round-trip of SecurityContextImpl(MediaTokenAuthentication).
KNOWN_ISSUES: ISSUE-159 opened (high, open) — mitigated by this change.
merge origin/main: renumber cast serializable issue to ISSUE-160 (collision with PR #1225's ISSUE-159)
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build Android CI image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 2m43s
1b3d54287c
chris merged commit a194af43b5 into main 2026-10-14 22:20:22 +02: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
chris/memories!1227
No description provided.