Self-service edit window dead — editWindowOpenedAt never populated
editarPractica self-service edit has NEVER succeeded since ship. practicas.editWindowOpenedAt is never set: omitted from create INSERT (practica-actions.ts:598-616), no schema default (schema.md:561), so 1048/1048 non-deleted rows have it NULL and max(editCount)=0. Window guard (practica-actions.ts:827-828) '(now()-editWindowOpenedAt)<=48h' has NO COALESCE → NULL→withinWindow NULL→!null=true→returns 'Pasó la ventana de 48h' for every attempt. Comment :760 documents intent 'editWindowOpenedAt (= createdAt)' but the equivalence was never wired. FIX (minimal, matches documented intent): COALESCE(editWindowOpenedAt, createdAt) in the guard predicate — instantly correct for all existing NULL rows, no backfill, reversible one-liner. Blast radius: only prácticas within 48h of createdAt become editable (old rows stay locked) — restores intended behavior, no mass-unlock. Date/window gate → audit pre-push review + PTD (Vercel READY + live-version + a real edit smoke within window). NOT applied yet.
Questions
Activity
-
Fixed dead self-edit window — COALESCE(editWindowOpenedAt,createdAt) at practica-actions.ts:828. Was NULL for 1050/1050 rows → every self-edit blocked since ship; now 157 in-window prácticas editable. SHA 2553d2d v0.81.11, audit PASS, /api/health live-verified. Restores CU-05b, loosens nothing else.