Prefetch Kagane covers during latest polling #51

Merged
sulthan merged 1 commits from issue-45 into main 2026-08-09 14:59:01 +07:00
Owner

Summary

  • Add an optional browser-backed cover fetcher to the latest-chapter poller.
  • Prefetch missing Kagane covers during the existing due-series cycle and persist them before a Reader opens the web UI.
  • Keep chapter polling, cooldown stamping, and on-first-view fallback independent from cover failures.

Behavior and safety

  • Stored Kagane covers are detected before browser work, so later poll cycles do not refetch them.
  • Nil cover fetchers and non-Kagane series retain the existing behavior.
  • Shared Kagane image-id and content-type validation prevents challenge or non-image responses from poisoning persistent cover storage.
  • The browser is wired into both the chapter and cover poller paths from the composition root.

Verification

  • go test ./...
  • Focused latest, store, and web package tests
  • Deterministic tests cover missing covers, cached covers, failed fetches, invalid content types, nil fetchers, and non-Kagane series.

Closes #45

## Summary - Add an optional browser-backed cover fetcher to the latest-chapter poller. - Prefetch missing Kagane covers during the existing due-series cycle and persist them before a Reader opens the web UI. - Keep chapter polling, cooldown stamping, and on-first-view fallback independent from cover failures. ## Behavior and safety - Stored Kagane covers are detected before browser work, so later poll cycles do not refetch them. - Nil cover fetchers and non-Kagane series retain the existing behavior. - Shared Kagane image-id and content-type validation prevents challenge or non-image responses from poisoning persistent cover storage. - The browser is wired into both the chapter and cover poller paths from the composition root. ## Verification - `go test ./...` - Focused latest, store, and web package tests - Deterministic tests cover missing covers, cached covers, failed fetches, invalid content types, nil fetchers, and non-Kagane series. Closes #45
sulthan added 1 commit 2026-08-09 07:51:12 +07:00
Add an optional cover fetcher to the latest-chapter poller and wire the shared browser into it. Each due Kagane series now checks persistent storage, fetches a missing cover once, and keeps chapter polling and cooldown bookkeeping independent when cover work fails.\n\nCentralize Kagane image-id and content-type validation so prefetched bytes cannot poison the on-first-view fallback, and cover the missing, cached, failure, nil-fetcher, invalid-type, and non-Kagane paths with deterministic poll-cycle tests.\n\nRefs #45
sulthan merged commit d1800d0707 into main 2026-08-09 14:59:01 +07:00
Sign in to join this conversation.