Skip to content

fix: harden household sync, playback, guide, and editor reliability - #51

Merged
thegregstengel merged 1 commit into
mainfrom
fix/repo-review-hardening
Nov 25, 2026
Merged

thegregstengel merged 1 commit into
mainfrom
fix/repo-review-hardening

Conversation

@thegregstengel

Copy link
Copy Markdown
Owner

What this changes

Addresses concurrency, security, correctness, and UX findings from a full repository review:

  • Core scheduling & secrets: Synchronized CyclicLineupStrategy layout cache access across ViewModels and background refreshers; added in-memory caching to SecretStore under its mutex.
  • Household protocol & coordinator: Enforced non-empty lineups in HouseholdReducer.updateChannel and added validateState for full remote/Drive state bounds validation; made Coordinator token map and PIN attempt counters thread-safe and moved pairComplete inside mutex.withLock; replaced Content-Length-only body checks in CoordinatorRoutes with bounded streaming reads; added a 10-second TLS handshake timeout in TlsFrontDoor.
  • Playback & providers: Converted recursive TuneController.runAiring into a loop and added latestChannel cutover checks at program boundaries; disabled HTTP redirects on Media3's OkHttp client to prevent server token leaks and fixed fallback audio track ID matching; honored mediaId in playbackOptions for Plex and Jellyfin and preserved inline item ordering in PlexProvider.playablesFrom.
  • Data layer: Stopped TimeSync SNTP loop when Automatic Time is disabled via collectLatest; prevented HouseholdService.memberLoop watcher leaks with try/finally, validated remote states in applyRemote, and cleared coordinatorFingerprint on promotion; validated Drive states and avoided redundant uploads in DriveSync.pullAndMerge; wrapped ChannelRepository.reorderRegulars in a database transaction and rejected empty refreshed lineups.
  • Features & docs: Handled HouseholdWriteException in GuideViewModel.toggleFavorite, unified guide rebuilds with a 1-minute holiday ticker, and pruned stale lineup cache entries; updated empty-favorites copy in GuideScreen; scoped StreamOptionsController video/audio choices to the current airing and wired latestChannel + holiday ticker in PlayerViewModel; fixed D-pad focus into LetterIndex, selected counter, and double library fetches in the Custom channel editor; fixed the release-channel update URL in SettingsViewModel; refreshed docs/architecture.md and SECURITY.md.

How you tested it

  • Ran ./gradlew detekt and all 10 pure-JVM test suites locally (:core:common:test, :core:model:test, :core:scheduling:test, :household:protocol:test, :household:coordinator:test, :household:client:test, :playback:core:test, :provider:plex:test, :provider:jellyfin:test, :provider:testing:test), including new unit tests for scheduler concurrency, remote state validation, chunked 413 body limits, and pending cutover boundaries.
  • Opening this PR so CI runs Android unit tests, :app:lintDebug, and :app:assembleDebug.

Checklist

  • This is my own branch targeting main.
  • ./gradlew detekt and pure-JVM tests pass locally; full Android suite running in CI.
  • No Plex tokens, keystores, or local config in the diff.
  • No code copied from other media clients.
  • CHANGELOG.md updated if needed.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@thegregstengel
thegregstengel merged commit 8af2cd4 into main Nov 25, 2026
4 checks passed
@thegregstengel
thegregstengel deleted the fix/repo-review-hardening branch November 25, 2026 13:51
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.

1 participant