Skip to content

merge queue: merged #7613, #7529: feat(billing): Paddle webhooks + applyBillingEvent (L3) (+1 more) - #7650

Closed
mergify[bot] wants to merge 10 commits into
devfrom
mergify/merge-queue/0fcb53759f
Closed

mergify[bot] wants to merge 10 commits into
devfrom
mergify/merge-queue/0fcb53759f

Conversation

@mergify

@mergify mergify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Note

This is a merge queue draft opened by Mergify. Its pull requests have merged, and nobody needs to act on it.
Mergify opened it for batch ethnic-selgris-nx55mk of the dev queue, to test #7613 and #7529 before they merged into dev.

🎉 What landed

Mergify merged each pull request into dev on its own, then closed this draft:

  • #7613 feat(billing): Paddle webhooks + applyBillingEvent (L3) (bobikenobi12), as ed1af82
  • #7529 feat(console): evidence waivers on keyset paging, no count pills (LST-6) (bobikenobi12), as 47e55d9

This draft's code was built in this order:

  1. dev at c421688
  2. #7613 + #7529, the pull requests of this batch, tested together as one tip

Bisected from a failed batch:

Metadata for CI tooling, read by mergify ci
---
all_scopes: false
checking_base_sha: c4216884a8bcac8355919f9d79dd26df50818040
previous_check_retries: []
previous_failed_batches:
  - batch_pr_head_sha: 20690d3a09650dd2b859396922fde1913c46e69b
    batch_pr_number: 7641
    checked_pull_requests:
      - 7613
      - 7529
      - 7535
      - 7623
      - 7524
      - 7551
      - 7621
    draft_pr_head_sha: 20690d3a09650dd2b859396922fde1913c46e69b
    draft_pr_number: 7641
pull_requests:
  - number: 7613
    scopes: []
  - number: 7529
    scopes: []
queue_base_sha: c4216884a8bcac8355919f9d79dd26df50818040
scopes: []
...
Required conditions of queue rule dev for merge
Required conditions to stay in the queue

bobikenobi12 and others added 10 commits November 25, 2026 04:14
/api/webhooks/paddle verifies Paddle-Signature (HMAC-SHA256 over ts:body,
constant-time, 5-minute window, any h1 during rotation; fails closed without
config), normalizes subscription/transaction/adjustment events into the
provider-neutral seam types, and applies each exactly once through the shared
(provider, event_id) ledger.

applyBillingEvent writes organization_billing under an occurred_at watermark
(no regression from out-of-order or replayed events, no revival of a canceled
subscription, one subscription per slot, never over a live Stripe one), keeps
the paddle_transaction mirror, grants credit packs once and reverses them on a
full refund or chargeback, and alerts the operator on chargebacks, partial
refunds and org mismatches. custom_data is untrusted: the row holding the
subscription decides the org; custom_data only names one that exists.

A Paddle past_due subscription keeps its plan for a 7-day grace
(entitlementStatus), wired into the entitlement readers; Stripe rows are
unchanged. The Paddle adapter is registered in the seam with parseWebhook;
purchase/plan/usage methods throw until L4/L5.
The recorded-waivers log rode inside the evidence roll-up behind
`.limit(100)` and was paged in the browser with a client `.slice`, so
waiver 101 and later were unreachable on a compliance record.

- `queryEvidenceWaiversPage` (lib/queries/evidence.ts): a keyset builder
  on the shared codec, ordered by the ms-truncated recorded time then the
  job id, reading limit + 1, no cap. New read procedure `evidence.waivers`.
- The in-force verdict is decided in SQL (`waiverInForce`, a CASE over
  `pg_input_is_valid`, so an unparseable expiry reads as expired, not as
  an error). The roll-up now reads only the in-force waivers, uncapped,
  which is all the posture needs (the waived facet, drawer, counter).
- evidence-waivers.tsx: `useKeysetList` + `ListFooter`; no CountPill, no
  "Showing the 100 most recent", no page numbers; region error, refresh
  notice and empty state.
- evidence-client.tsx: the Environments heading loses its count; the
  skeleton loses the pill placeholder.
- Ledger: evidence-waivers.json deleted; evidence.json is the `bounded`
  decision for the one-row-per-environment roll-up.
- Tests: builder unit test (limit + 1, cursor of the last kept row under
  ties, later-page predicate, universeEmpty), panel walk to row 130 with
  ties across boundaries, footer failure/retry, empty and first-page
  error, a real-Postgres integration test, and a tenancy fixture for the
  new procedure.

Closes #7488
@mergify mergify Bot changed the title merge queue: checking #7613 + #7529 together on dev (c421688) merge queue: merged #7613, #7529: feat(billing): Paddle webhooks + applyBillingEvent (L3) (+1 more) Nov 25, 2026
@mergify mergify Bot closed this Nov 25, 2026
@mergify
mergify Bot deleted the mergify/merge-queue/0fcb53759f branch November 25, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant