You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(plans): open step rows orphaned before #1046 and scheduled steps of deleted plans #1048
#1046 cancels a plan's open step rows (pending, notified, paused) inside DeletePurchasePlan, so deleting a plan no longer leaves approvable plan-less rows. Two cases are left over:
On existing deployments, plans deleted before #1046 left their open step rows with plan_id NULL (purchase_executions.plan_id is ON DELETE SET NULL). Token approval skips requirePlanStepCap and the approve-own plan-step rule when PlanID == "", so those rows can still be approved with no cap.
A backfill needs a reliable way to tell an orphaned plan step from an ad-hoc execution. No current column does that: step_number defaults to 1 for both. Options:
add a marker (for example source or a nullable deleted_plan_id) going forward, plus a one-off best-effort backfill;
cancel every open plan-less row older than a cutoff (this risks canceling legitimate ad-hoc rows);
leave them and document a manual cleanup query.
Any migration should take the next free number: 000126 is the highest on main, and the open #1020 and #1022 add 000127 and 000128.
2. scheduled rows of a deleted plan
#1046 deliberately leaves scheduled rows alone, because they were approved while the plan existed. They still fire at their scheduled time after the plan is deleted. Whether deleting a plan should also revoke its scheduled steps is a product decision.
Activity