Yokan / rebuild
Course 1 8624561

SMART_UPDATE_RULES.md

docs/features/SMART_UPDATE_RULES.md

documentation / design asset49 lines
1# Smart update rules and group refresh scope23Library settings offers separate restriction switches for each media type:45- **Skip completed titles** excludes titles whose stored status is Completed.6- **Only update caught-up titles** skips titles with any known unread/unseen release.7- **Only update started titles** requires a read release or finite positive progress8  when releases are known. Empty titles remain eligible to discover their first list.9- **Respect expected release period** honors the automatic cadence or the title's10  manual update interval. An explicit zero-day interval remains every-update.1112The first three switches default off; expected-period checking defaults on, preserving13Yokan's existing behavior. Restrictions combine, and apply to manual library refreshes14and scheduled refreshes through the same service. They use known release records;15reader display/release filters do not discard records from these admission checks.16Explicit single-title refresh remains available independently of library restrictions.1718**Library refresh scope** defaults to Entire library. Current group refreshes the19selected manual category, source, status, tracker-status or tag group. The third choice20uses the current group except when Ungrouped is selected, which refreshes all eligible21titles. The All page also uses global scope. Membership is captured before the request,22independently of text searches and row filters. A missing/stale group or unloaded23projection produces an empty scope; it cannot silently expand to a full-library run.24Scheduled jobs and refreshes from Updates/Calendar remain global, honoring category,25pinned-source and smart-update restrictions.2627The service defensively copies captured IDs, intersects them with the requested media28type's current favorites, and applies the existing source/category admission checks.29A profile-owned service mutex serializes scheduler, controller and single-title calls.30Cancellation of a waiting caller leaves the service usable. Existing late-response31guards still preserve local edits and reject deleted/replaced source identities.3233Final error reports update settings atomically and replace only the run's captured34media/group error scope. They preserve concurrent preference changes and error reports35from other groups or media types. The controller still reports only this run's errors.3637Preferences and controls are shared across Android, iOS, desktop and web and persist38per profile under the existing device-local feature settings. Device/network/power39constraint selection is documented in `AUTOMATIC_UPDATE_CONSTRAINTS.md`, including40the visible deferral behavior when telemetry is unavailable.4142Verification: 62 desktop checks and 62 Kotlin/Wasm browser tests passed, with no43failures, errors or skipped tests. Desktop, Android, iOS simulator ARM64 and web44compiled. Tests cover defaults, cadence overrides, combined rules,45empty titles, malformed progress, per-media serialization, raw group scope despite46search filters, stale/empty groups, service serialization, cancelled waiters, scoped47error retention and concurrent preference preservation. The serialized-call test48counts actual extension requests, proving a waiting caller does not start a second49fetch. Unchanged error reports avoid redundant settings writes.50

Search chapters, reference and source filenames.