Skip to content

[bug] Android TV Watch Next sync reads all of Home every hour, including during playback #624

Closed

Description

@Quick104

What happened

The Android TV Watch Next sync downloads and decodes every Home row to fill the launcher's Continue Watching tiles. It keeps only the continue_watching and next_up rows and throws the rest away.

The sync runs every hour in the app's process, including while a video plays. With a large Home (dozens of rows of up to 100 items) one read builds the whole response as a single string of several megabytes and then decodes it. On a device with a 192 MB Java heap, where the player can hold up to half the heap in buffers, that read can run the app out of memory. This is the same kind of read behind silo-android#623.

Steps to reproduce

Not reproduced live. Found from source while fixing silo-android#623.

  1. On Android TV, sign in to a profile whose Home has many rows with high item limits.
  2. Play an episode or movie for more than an hour, so the hourly Watch Next sync runs during playback.
  3. The sync calls GET /api/v2/home/sections and decodes every row (androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/watchnext/WatchNextHomeSync.kt:42) before filtering by section type (line 48).

Expected behavior

The sync reads only what Watch Next shows. GET /api/v2/home/layout (no include_items) lists the sections with their id and section_type. The sync can then read just the continue_watching and next_up rows through GET /api/v2/home/sections/{id}/items. Both endpoints exist on every v2 server.

Silo version / commit

silo-android origin/main at 33945a0. Server origin/main (the layout endpoint has been there since the API v2 migration).

Deployment

Any.

Clients affected

Android TV only. The phone app has no Watch Next sync.

Relevant logs

No logs available.

Technical notes

  • Raised in the plan review for silo-android#623 and listed as a follow-up in silo-android#551 ("the TV Watch Next sync still downloads all of Home just to get Continue Watching").
  • The fix for silo-android#623 stops Home's own realtime refreshes while the player covers Home. It does not cover this worker.

AI harness

Claude Code, running in T3 Code

AI tool(s)

Claude Code; Codex (cross-provider plan review)

AI model(s)

claude-opus-5-5; gpt-6.1-sol (review)

AI involvement

AI-found from source; not reproduced on a device.

Independent or adversarial review

A Codex review of the silo-android#623 fix plan raised it. The source lines above confirm it.

Confirmations

  • I searched open and recently closed issues and pull requests, and this is not already reported
  • I reproduced this myself on a real deployment

Source: found in review of the fix for silo-android#623

Activity

  1. added
    bug
    on Oct 18, 2026
  2. added
    priority: P2
    on Oct 18, 2026
  3. feardubin commented on Nov 1, 2026

    @feardubin
    Contributor

    I've opened #775 for this. I haven't had a PR merged in a Silo repository and wasn't asked first, so please close it if you'd rather implement the fix yourselves.

    The issue says this wasn't reproduced on a device. Here's a live occurrence:

    • Device: 2018 Fire TV Stick 4K (AFTMM), Android 7.1.2, Silo Android TV 1.0.0 (28), which already includes fix(tv): stop re-reading Home while the player covers it #626.
    • During playback, the server logged a background GET /api/v2/home/sections of about 1.02 MB to the device. About 1 s later the app crashed with java.lang.OutOfMemoryError in StringFactory.newStringFromChars. The failed 2,033,584-byte allocation is that body as a UTF-16 string.
    • It happened twice, 59 minutes apart, which fits the hourly sync.

    The server log doesn't name the caller. One of the two reads came just before a new playback started, which also fits the player's On Deck load (TvPlayerViewModel reads all of Home at playback start), so that path may need its own fix.

    #775 makes the sync read GET /api/v2/home/layout, then only the continue_watching and next_up rows (capped at 20 cards, as Home draws them), and never GET /api/v2/home/sections.

    AI disclosure: written with Claude Code (claude-opus-5-5), reviewed with Codex (gpt-6.1-sol). Involvement: fully AI-generated.

  4. added a commit that references this issue on Nov 2, 2026
    6b61cc5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions