Yokan / rebuild
Course 1 8624561

UPDATE_CONSTRAINTS_NOTES.md

docs/parity/UPDATE_CONSTRAINTS_NOTES.md

documentation / design asset53 lines
1# Stage 4 implementation notes23The device-constraint implementation is verified in `../features/AUTOMATIC_UPDATE_CONSTRAINTS.md`,4including concrete telemetry limits. Updates/Upcoming filtering is5implemented in `../features/ACTIVITY_FILTERS.md`; smart rules and group scope are6implemented and verified in `../features/SMART_UPDATE_RULES.md`.78## Upstream behavior and compatibility910Animetail revision `d0eab5d6237dd09ebdb21a63fff5b66097c91087` exposes separate11Wi-Fi-only, unmetered and charging restrictions. Its smart-update switches skip12completed titles, titles with unread/unseen releases, known-but-unstarted titles,13and titles outside the expected release period. Empty titles remain eligible for14the started restriction so their first release list can still be discovered.15Yokan already calculates automatic cadence and accepts a manual zero/every-update16interval; defaults must preserve its existing scheduling behavior.1718Group update mode in the upstream worker is Global, current group, or all groups19when Ungrouped is selected. Manual group scope must be computed from raw membership,20before text/row filters, and captured as title IDs. All and an empty group must21remain distinct: an empty/stale selection cannot silently become a full-library run.22Scheduled refreshes must have an explicit stable scope rather than depend on a23currently composed UI or mutable global profile accessor.2425Foreground/OS periodic refreshes call `LibraryUpdaterService` directly, alongside26manual controller runs. The implementation adds service-level serialization and27atomic, scoped update-error settings writes. Preserve these while adding device28constraints; do not discard concurrent preference changes or another media type's29error report.3031## Platform evidence checked 2026-10-153233- Android WorkManager supports charging/network constraints and stops work if a34  required constraint becomes unmet. Apply library-specific constraints only to35  library work; changing them must update daily work even when its time is unchanged.36  [Official work-request documentation](https://developer.android.com/develop/background-work/background-tasks/persistent/getting-started/define-work).37- iOS `BGProcessingTaskRequest` provides `requiresExternalPower` and38  `requiresNetworkConnectivity`. Foreground refreshes need the same shared admission39  rules as OS workers. Existing fixed background identifiers belong to the Default40  profile; preserve that ownership.41  [Apple task-request documentation](https://developer.apple.com/documentation/backgroundtasks/bgprocessingtaskrequest).42- Battery Status is a secure-context browser API with limited browser availability;43  a browser may also obscure the actual condition. A missing/denied API cannot be44  treated as evidence that a selected restriction is satisfied. Implement observable45  unknown/deferred outcomes and document concrete browser limits; do not claim a46  universal hardware capability or silently bypass the selected restriction.47  [W3C specification](https://www.w3.org/TR/battery-status/),48  [MDN compatibility overview](https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API).4950Existing network helpers use permissive fallback values on several platforms and51desktop/web currently report unmetered unconditionally. They are insufficient proof52for new explicit user-selected device restrictions. Keep existing download semantics53stable while introducing a richer, testable update-condition observation boundary.54

Search chapters, reference and source filenames.