Skip to content

v0.6.0

Choose a tag to compare

@sfelixalejandro sfelixalejandro released this 19 Nov 07:32
· 13 commits to main since this release
4df7792

Added & Changed

  • Durable Reconciliation Checkpoints (last_reconciled_at): Added nullable protected attribute last_reconciled_at (:utc_datetime_usec) to AshBilling.Subscription. See Upgrading to 0.6 for the required database migration.
  • PostgreSQL Shared-Clock Checkpointing: AshBilling.reconcile_subscription/2 queries PostgreSQL clock_timestamp() under canonical Customer -> Subscription FOR UPDATE locks, omits fabricated local timestamps ("created" => nil), and persists last_reconciled_at monotonically and atomically in the same transaction as reconciled state.
  • Post-Reconciliation Financial Verification: When last_reconciled_at is present, AshBilling.WebhookSync evaluates critical synchronized financial attributes (status, price_id, current_period_end, trial_ends_at, cancel_at_period_end, cancel_at) before applying non-terminal or delayed terminal webhooks. Safe fast paths (duplicates, event.created < last_event_created_at, or identical snapshots with no financial diff) skip provider calls, while any financial difference triggers live provider re-verification under FOR UPDATE regardless of event.created age, failing closed on provider or PostgreSQL errors with no ETS state.
  • 0.5.x Upgrade Cursor Healing & Operational Guidance: AshBilling.reconcile_subscription/2 now automatically clears ahead/future last_event_created_at values (> PostgreSQL clock_timestamp()) to nil atomically alongside persisting last_reconciled_at (and supports reset_event_cursor?: true for shared app+DB forward clock skew), preventing synthetic 0.5.x reconciliation timestamps from causing existing_event_newer?/2 to ignore legitimate Stripe webhooks. Documented explicit quantity persistence scope and HTTP timeout / FOR UPDATE lock hold / PostgreSQL pool sizing recommendations in Upgrading to 0.6.