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
Commit ff55a60
Browse filesBrowse the repository at this point in the historyBrowse files
fix(db): make cancelled->canceled rename truly dual-compatible during EXPAND
Address CodeRabbit review on PR #1277. The expand-contract rename must accept
both spellings/columns throughout the EXPAND phase; only the deferred contract
migration (#1278) removes the legacy spelling.
Down migration (CRITICAL rollback bug + actor loss):
- Reorder the DOWN path so data is converted 'canceled'->'cancelled' BEFORE the
'cancelled'-only CHECK constraints are re-added. The old order re-added the
narrowed constraint first, so any row still in the new state violated it and
the whole rollback failed.
- Backfill canceled_by into cancelled_by BEFORE dropping canceled_by so actor
attribution recorded by new code during the deploy window survives.
Reads stay dual-compatible:
- handler_history.go: accept both 'canceled' and 'cancelled' in the history
fetch filter and in the KPI-summary / annotation switches so legacy rows
written mid-deploy are neither dropped nor allowed to inflate KPIs.
- store_postgres.go: project COALESCE(canceled_by, cancelled_by) on every read
so a late legacy write landing in cancelled_by is still surfaced.
- handler_purchases.go: the cancel-recovery idempotency check accepts both
spellings.
Scheduled-cancel routing (doc + predicate reconciliation):
- interfaces.go: align the CancelExecutionAtomic doc to the implementation
(pending/notified only; scheduled is handled by CancelScheduledExecutionAtomic).
- types.go: add IsImmediatelyCancelable (pending/notified) distinct from the
broader IsCancelable (adds scheduled). The /cancel paths
(cancelPurchaseViaSession, loadCancelableExecution) now gate on the narrow
predicate so a scheduled row is routed to a clear "use the revoke endpoint"
409 instead of misrouting into the pending/notified-only CAS and surfacing a
misleading "concurrent operation" error.
Tests:
- New integration test 000078_..._test.go exercises up (both spellings accepted,
legacy backfilled) and down (rollback succeeds with 'canceled' rows present,
data converted back, actor attribution preserved, narrowed constraint restored).
- Unit tests for the cancelable predicates and the scheduled-routing behaviour
on both cancel paths.
0 commit comments