fix(r5): address the second /code-review high round — 7 findings

- the volume keys no longer defer to a scrollable card while in fullscreen
  (mirrored into a ref: the keydown handler is bound once and state would be stale)
- the debounced volume flush writes straight to storage; persisting inside a
  setState updater is not guaranteed to run for an unmounting component
- the HLS sweep also matches the original {key}_{start} directory naming, which
  is what the oldest leftovers on disk actually use
- run_rss_poll returns {new, failed} so an egress outage stops rendering as
  "ok — 0" in the scheduler card and the audit log; /api/sync/rss reports it too
- drop the unused poll_rss_channel (it silently gained a new exception)
- _Breaker.run is generic, so a call site keeps its item-id type
- test helper instead of the generator-throw idiom
This commit is contained in:
2026-07-23 23:59:58 +02:00
parent 2a7f49c981
commit 53ff61653d
7 changed files with 55 additions and 26 deletions
+6 -2
View File
@@ -48,7 +48,11 @@ def get_service_user(db: Session) -> User | None:
return users[0] if users else None
def run_rss_poll(db: Session, channels: list[Channel] | None = None) -> int:
def run_rss_poll(db: Session, channels: list[Channel] | None = None) -> dict:
"""Poll every channel's free RSS feed. Returns `{"new": inserted, "failed": unreadable_feeds}`
— the failure count is part of the RESULT, not just a log line, so the scheduler card and the
audit summary can tell "no new uploads" apart from "every feed was unreachable" (an egress
outage otherwise renders identically to a quiet hour)."""
if channels is None:
channels = db.execute(select(Channel)).scalars().all()
total = len(channels)
@@ -89,7 +93,7 @@ def run_rss_poll(db: Session, channels: list[Channel] | None = None) -> int:
progress.report(done, total, "rss_poll")
if failed:
log.warning("RSS poll: %d/%d channel feeds could not be read", failed, total)
return new
return {"new": new, "failed": failed}
def run_enrich(db: Session, max_batches: int = 200, floor: int = 200) -> int: