openreader/drizzle/postgres
Richard R 848ee4faad feat(tasks): add document blob lease for safe orphan reaping and improve scheduled task robustness
Introduce a document blob lease mechanism to prevent race conditions between document registration and orphaned blob cleanup. The new `document_blob_leases` table ensures that only one process can claim a document blob for mutation or deletion at a time. Update the orphan reaper to acquire a lease before deleting blobs and to re-check for ownership after acquiring the lease, avoiding accidental deletion of in-flight uploads.

Enhance scheduled task infrastructure with per-task fencing tokens to prevent stale runners from overwriting newer results, enforce runtime limits with abort signals, and expose scheduler mode and minimum interval to the admin panel and API. Adjust task handlers to accept a context with abort support, and update documentation and environment variable references for the new cron secret and scheduling behavior.

BREAKING CHANGE: Scheduled tasks now require a `document_blob_leases` table and updated handler signatures. Vercel deployments must set `CRON_SECRET` for scheduled maintenance.
2026-06-07 12:08:57 -06:00
..
meta feat(tasks): add document blob lease for safe orphan reaping and improve scheduled task robustness 2026-06-07 12:08:57 -06:00
0000_black_lucky_pierre.sql refactor: Standardize database timestamp fields to bigint epoch milliseconds and update schema migrations. 2026-02-17 21:00:36 -07:00
0001_tts_segments.sql feat(reader,db): add segments sidebar and manifest API; update TTS segment schema 2026-05-04 15:02:05 -06:00
0002_add_segment_key_to_tts_segments.sql feat(tts,epub,db): enforce stable EPUB segment locators and add segmentKey identity 2026-05-12 16:18:36 -06:00
0003_tts_segments_v2_split.sql refactor(tts,db,manifest): split tts_segments into normalized entry and variant tables 2026-05-12 17:44:57 -06:00
0004_admin_panel.sql feat(admin,config,ui,db): introduce runtime-editable site config and admin-managed TTS providers 2026-05-12 22:39:24 -06:00
0005_pdf_layout_and_compute.sql refactor(pdf): implement ONNX-based Docling layout parsing and block-level TTS for PDFs 2026-05-17 21:18:51 -06:00
0006_preview-defaults-cleanup.sql refactor(previews): update preview variant defaults, cache schema, and image handling 2026-05-18 05:20:20 -06:00
0007_pdf_parse_progress.sql feat(pdf): implement granular PDF parse progress tracking and migrate to parseState 2026-05-21 10:27:16 -06:00
0008_user_job_events.sql feat(rate-limit): add per-user PDF parsing rate limiting and job event ledger 2026-05-30 14:17:49 -06:00
0009_drop_pdf_parse.sql refactor(db): remove legacy PDF parse fields from documents schema 2026-06-04 20:17:23 -06:00
0010_user-data-cleanup-cascades.sql feat(data): enhance anonymous claim to support document settings and TTS segment copy 2026-06-06 19:12:40 -06:00
0011_scheduled-tasks.sql feat(tasks): add document blob lease for safe orphan reaping and improve scheduled task robustness 2026-06-07 12:08:57 -06:00