siftlode/backend/app/downloads
npeter83 4e80e2b39b fix(deferred): close backend correctness/efficiency tails from the hygiene sweep
Verified each deferred per-subsystem item against current source, then fixed the
real ones (tradeoffs left as-is, see siftlode-ops/CODE-HYGIENE.md closeout):

- search BUG-3: don't finalise shorts_probed on un-enriched stubs (enrichment
  failure/omitted rows) — restores the scheduler's enriched_at guard so a real
  Short can't leak into the feed and never get reclassified.
- downloads GC: 4th pass reaps orphaned errored, fileless, unreferenced assets
  (they carry no TTL, so the expiry passes never cleared them).
- downloads B6: quota/edit errors now return a structured {code,reason,limit}
  the trilingual client localises, instead of hardcoded English + dot-decimal GB.
- channels BB1: reset-backfill re-arms deep sync on every subscriber (bulk update)
  instead of 404ing when the admin isn't personally subscribed.
- channels BB2: enrich the stub on BOTH the normal and "already exists" desync
  path (nest the insert try inside the client `with`).
- channels CB3: drop the redundant second _discovery_rows read (identity-mapped
  rows are already enriched; re-sort in Python for the title tie-break).
- playlists PC1: read the live playlist once in push() and share it with plan_push
  + push_playlist (halves read-quota, closes the second TOCTOU window).
- playlists PC2/PC5: batch the cover thumbnails in one window query (was N+1);
  rename combines count+duration into one aggregate + a single cover lookup.
- messages MB2: get_thread only resolves a messageable partner OR one we already
  share a thread with (closes the user-enumeration oracle).
- messages MB3: push a live unread-count to the user's other tabs after mark-read.
- messages MC4: list_conversations uses DISTINCT ON + grouped COUNT instead of
  loading the whole message history into memory.
- config AB3: per-spec allow_empty so smtp_user/youtube_api_proxy can be blanked
  to disable them rather than snapping back to the env default.
2026-07-12 05:59:03 +02:00
..
__init__.py fix(downloads): add the downloads package (was wrongly gitignored) + robust sanitizer 2026-07-03 00:19:22 +02:00
backfill.py fix(share): self-host og:image so link previews stay reliable 2026-07-07 22:43:18 +02:00
edit.py fix(downloads): repair 5 confirmed backend bugs (B1-B5) 2026-07-11 16:15:12 +02:00
formats.py Merge branch 'dev' into chore/code-hygiene 2026-07-11 16:22:39 +02:00
gc.py fix(deferred): close backend correctness/efficiency tails from the hygiene sweep 2026-07-12 05:59:03 +02:00
links.py chore(downloads): C3-C6 — DRY the source-URL, filename, and serialize helpers 2026-07-11 05:47:51 +02:00
og.py fix(share): self-host og:image so link previews stay reliable 2026-07-07 22:43:18 +02:00
quota.py feat(downloads): M4 — REST API (enqueue, manage, file-serve, sharing, admin) 2026-07-03 00:34:08 +02:00
service.py Merge branch 'dev' into chore/code-hygiene 2026-07-11 16:22:39 +02:00
storage.py chore(downloads): C3-C6 — DRY the source-URL, filename, and serialize helpers 2026-07-11 05:47:51 +02:00