diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-11-08 20:38:55 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-11-08 20:38:55 +0000 |
| commit | 65ae792d5393fbfcc304ac683f54f6fcdca10a2c (patch) | |
| tree | 7f5319c9e13399d61a8be80ea1c2ce7f49f56b5e /tools | |
| parent | 68a8d692f03ddc48aaf70399bfb1cc7584e21810 (diff) | |
Refresh on any connection; leave the download guard where it belongs
Peter's mobile data is not metered, so the UNMETERED constraint on the refresh worker was doing
nothing for him -- and the question was whether to mark the connection metered or drop the guard.
Neither, quite.
The guard was never about the cost of refreshing. Its own comment said so: "refreshing every feed
is cheap, but downloads that follow are not". It was a proxy for a guard on downloads, and the
refresh is genuinely cheap -- every request carries If-None-Match and If-Modified-Since, so an
unchanged feed is a 304 with no body and a whole sweep is a few hundred bytes a show. Waiting for
Wi-Fi to spend that is what let a failed refresh from hours earlier stay on screen as the current
state of the library.
So refresh runs on any connection now, and the download worker keeps its unmetered and
battery-not-low constraints, which is where the expensive unattended work actually is.
Marking the connection metered would have worked too, and is worse: it is a system-wide setting
changed to compensate for one app, affecting every other app on the phone.
**What the guard was really hiding, and still is:** anything reaching the queue calls
Scheduling.downloadNow, which has no network constraint at all -- deliberately, because Peter
asked for things he queues to download immediately including on mobile data. An auto-queue rule
firing during a background refresh goes down that same path, so a rule can start tens of
megabytes unattended on cellular. That is fine while his data is unmetered and is the real hole
if it ever is not; distinguishing "I queued this" from "a rule queued this" is the fix, and it is
not in this commit.
1059 tests, detekt 0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions
