fix(android): backup button stuck on „Sichert …" — periodic ENQUEUED no longer counts as active #1400

Merged
chris merged 2 commits from fix/backup-button-stuck-enqueued into main 2026-10-26 10:34:12 +01:00
Owner

Problem (device-reproduced, Pixel 2 / LineageOS)

On the Sicherung tab the primary button permanently showed „Sichert …" (disabled, presses no-op) while nothing ran. Counters 0, „Letzter Lauf: Geplant".

Root cause

BackupStatusUiState.isWorkActive treated BackupWorkState.ENQUEUED as active. The UI snapshot (WorkManagerBackupStatusSource.observe) falls back to the periodic WorkInfo when no one-off row exists — and a periodic job sits ENQUEUED virtually forever (waiting for its next 6h window; JobScheduler on-device confirmed: constraints satisfied, only TIMING_DELAY unsatisfied, no immediate-work job registered). So the fallback mapped "schedule waiting" → "run active": button disabled forever, backupNow()/retryFailed() early-return no-ops.

Fix

  • BackupWorkSnapshot.isPeriodic: the periodic fallback marks its snapshot
  • isWorkActive: RUNNING counts from either source; ENQUEUED only for the one-off
  • LastRunCard: periodic-ENQUEUED shows the idle label ("Noch kein Lauf aufgezeichnet") instead of the lying „Geplant"
  • Tests: snapshot mapping (incl. periodic RUNNING progress), isWorkActive cases, label mapping — 843 app-module tests green
  • versionName 0.10.14 + changelog, KNOWN_ISSUES ISSUE-208
## Problem (device-reproduced, Pixel 2 / LineageOS) On the Sicherung tab the primary button permanently showed **„Sichert …"** (disabled, presses no-op) while nothing ran. Counters 0, „Letzter Lauf: Geplant". ## Root cause `BackupStatusUiState.isWorkActive` treated `BackupWorkState.ENQUEUED` as active. The UI snapshot (`WorkManagerBackupStatusSource.observe`) falls back to the **periodic** WorkInfo when no one-off row exists — and a periodic job sits ENQUEUED virtually forever (waiting for its next 6h window; JobScheduler on-device confirmed: constraints satisfied, only TIMING_DELAY unsatisfied, no immediate-work job registered). So the fallback mapped "schedule waiting" → "run active": button disabled forever, `backupNow()`/`retryFailed()` early-return no-ops. ## Fix - `BackupWorkSnapshot.isPeriodic`: the periodic fallback marks its snapshot - `isWorkActive`: RUNNING counts from either source; ENQUEUED only for the one-off - `LastRunCard`: periodic-ENQUEUED shows the idle label ("Noch kein Lauf aufgezeichnet") instead of the lying „Geplant" - Tests: snapshot mapping (incl. periodic RUNNING progress), isWorkActive cases, label mapping — 843 app-module tests green - versionName 0.10.14 + changelog, KNOWN_ISSUES ISSUE-208
Device-reproduced (Pixel 2 / LineageOS): the status snapshot falls back to
the PERIODIC WorkInfo when no one-off row exists. A periodic job sits
ENQUEUED virtually forever (waiting for its next 6h window), and
isWorkActive mapped that to run-active - the primary button stayed
disabled on Sichert and backupNow()/retryFailed() became no-ops.

- BackupWorkSnapshot gains isPeriodic; the periodic fallback marks it
- isWorkActive: RUNNING always counts; ENQUEUED only for the one-off
- LastRunCard: periodic-ENQUEUED shows the idle label instead of Geplant
- tests: snapshot mapping, isWorkActive cases, label mapping
- versionName 0.10.14 + changelog
docs(known-issues): ISSUE-202 backup button stuck on Sichert (resolved)
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 / 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 / Deploy review instance (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 8s
Build and Deploy / Android unit tests and debug APK (push) Successful in 1m56s
ff759e7be2
chris merged commit f1446dcc35 into main 2026-10-26 10:34:12 +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
chris/memories!1400
No description provided.