Skip to content

[bug] Android keeps download progress on the device only, and it overrides the server's watched state #846

Closed

Description

@zZebrahz

What happened

On the Android phone, progress made while playing a downloaded title stays on the device. The server never receives it, so other devices and the web never see it.

That local copy also overrides the server. The shared overlay lets any local position larger than the server's win, and a watched title has no position on the server. Once another device finishes a title, the phone still offers "Continue Watching? You stopped at 10:46." for it, and the episode card shows the watched check together with a progress bar.

#842 is the same overlay rule on Android TV. #845 stops the TV player from saving sequenced sessions locally, but not this.

Steps to reproduce

On a Silo dev deployment, as a regular user with downloads allowed, on an Android 16 phone emulator:

  1. Download a movie (here: a 24-minute title).
  2. Turn on airplane mode. Play the download, skip to about 10:30, and press Back.
  3. Turn airplane mode off, relaunch the app and wait 90 seconds.
  4. Read the profile's progress on the server (GET /api/v2/progress): it has no entry for the title.
  5. On the phone, open the title and tap Play: "Continue Watching? You stopped at 10:46."
  6. Finish the title on another client (here POST /api/v2/sync/progress with a position past the watched threshold). The server stores completed: true, position_seconds: 0.
  7. Relaunch the phone app and open the title. Watched is set, and tapping Play still offers "You stopped at 10:46."
  8. The same with a downloaded episode: after step 6, the series page's episode card shows the watched check and a progress bar at the old local position, and "Play S1·E1" offers to resume.

Expected behavior

Progress from downloaded playback reaches the server once the phone is back online, through /api/v2/sync/progress with the time it happened. After that the server decides what the title shows. A title the server has marked watched offers Play.

Silo version / commit

silo-android fix/issue-842-resume-after-watched 9efdf93 (main f13a265 plus #845, which changes no phone code on this path), phone debug build. silo-server main a52941174.

Deployment

Local dev sandbox (Docker), server built from main.

Clients affected

Android phone. Android TV uses the same local store and overlay. Apple keeps local progress only for downloads and syncs it with updated_at; Roku keeps none.

Relevant logs

Offline playback of the download (phone logcat):

I PlayerViewModel: tryLocalPlayback: serving Thats My Boy (2015) [WEBDL-480p 8-bit x264 AAC 2.0][ML]-SWARM.mkv (124931851B) for content=movie-tmdb-647677 (sidecar id=151033113391155575) offlineAudio=1 sidecarSubtitles=8

App database after exiting the player (user_item_state and dirty_operations):

['contentId', 'fileId', 'positionSeconds', 'durationSeconds', 'clientUpdatedAtMs', 'positionUpdatedAtMs']
('movie-tmdb-647677', 62, 646.472, 1453.456, 1794090285797, 1794090285797)
['id', 'opKind', 'targetContentId', 'state', 'payloadJson']

Server progress for the profile 90 seconds after reconnecting; the server log for those minutes has no progress or playback-session request from the phone:

{"items":[],"page":{"has_more":false}}

Technical notes

Why progress is lost:

  • PlayerViewModel.tryLocalPlayback starts no server session, so nothing reports progress during downloaded playback.
  • RoomUserItemStateRepository.recordPositionOwned writes the Room row and returns before enqueuing SET_POSITION when ebookAuthorities is set (android-shared/.../RoomUserItemStateRepository.kt, the if (ebookAuthorities != null) return@withTransaction line). AndroidModule and AndroidTvModule both set it.
  • SyncEngine drains only ebook progress and holds legacy personal-data rows unsent, so even an enqueued SET_POSITION would never be sent.

Why stale positions win:

  • applyLocalPlaybackProgress / localProgressWins in shared/.../viewmodel/LocalUserStateOverlay.kt compare positions only. Phone detail, episode rails and Home sections all use it.

On the phone, streaming did not leave local positions in this run: Back, pause then the on-screen back arrow, and backgrounding all left only a track-selection row with position 0. PlayerViewModel.maybeRecordPosition still guards on the UI-state sessionId, which exit clears before the player's last pause; that is the TV race #845 fixed with exitSessionId.

The server already supports the fix. POST /api/v2/sync/progress takes updated_at per item, applies the watched and minimum-resume thresholds (userstore.ResolveProgressState) and newest-write-wins (SetProgressIfNewer). docs/downloads-api.md §9.2 and §11.6 describe this offline queue for Android.

Agreed design:

  1. Write a local resume position only for downloaded (local-file) playback. Streaming never writes one, on phone or TV. The phone's maybeRecordPosition guard gets the same treatment fix(tv): show Play, not Resume, after a title is marked watched #845 gave TV.
  2. Queue each offline position with its event time and send it through /api/v2/sync/progress with updated_at. Delete the local position once the server accepts it; from then on the server is the truth.
  3. Change the overlay rule from "local is bigger, so it wins" to "only a local position still waiting to sync wins". After sync, local never overrides the server.
  4. One-time cleanup: delete local resume positions for anything that isn't a download on this device. Keep track fingerprints, CFI and reading progress in the same table.

No client-side copy of the watch threshold. A finished offline download may show Resume until it syncs.

This resolves #21 (offline progress queue). It changes files #845 changes, so the fix stacks on #845.

AI harness

Claude Code

AI tool(s)

T3 Code device tools (Android emulator), GitHub CLI

AI model(s)

claude-opus-5-5

AI involvement

Reproduced, investigated and wrote this issue, directed by a maintainer who agreed the design.

Independent or adversarial review

None yet.

Confirmations

  • I searched open and recently closed issues and pull requests, and this is not already reported (Downloads: offline watch-progress queue with server reconciliation #21 covers the sync part and is referenced above)
  • I reproduced this myself on a real deployment
  • Any logs provided are raw apart from marked redactions and are not AI-summarized; if none were available, I said so above

Source: follow-up to #842 and #845, reproduced on a dev sandbox.

Activity

  1. added
    bug
    on Nov 7, 2026
  2. self-assigned this
    on Nov 7, 2026
  3. zZebrahz commented on Nov 7, 2026

    @zZebrahz
    ContributorAuthor

    🤖 AI agent claim. Claude Code (claude-opus-5-5) is working on a fix for this issue on behalf of @zZebrahz, who is assigned.

    A pull request will link here when the fix is ready. If the work stops without a fix, the assignment and this comment are removed.

    Planning to work on this, or have context to add? Reply here and mention @zZebrahz.

  4. added
    impact: usability
    priority: P1
    triaged
    on Nov 7, 2026
  5. added a commit that references this issue on Nov 15, 2026
    4fc63d0
  6. added a commit that references this issue on Nov 16, 2026
    a404577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugimpact: usabilitypriority: P1triaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions