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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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 -> SubscriptionFOR 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.