Skip to content

fix(customers): canceled card trials churn, abandoned checkouts never started - #642

Merged
JeremyFunk merged 4 commits into
fix/customers-unpaid-ended-planfrom
fix/customers-ended-plan-signals
Nov 24, 2026
Merged

JeremyFunk merged 4 commits into
fix/customers-unpaid-ended-planfrom
fix/customers-ended-plan-signals

Conversation

@JeremyFunk

@JeremyFunk JeremyFunk commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #632.

Hazel treated every plan that ended without a payment the same way: the account stayed a lead, showed "Started" and "Canceled", kept getting usage signals, and never got a churn signal.

Abandoned checkouts

  • Autumn inserts a pending plan when checkout opens and expires it with the session. Hazel now recognises that row: ended, no cancellation, no processor subscription, within a day, on a paid plan.
  • The activity shows "Abandoned checkout for Startup" in place of "Started" and "Canceled", and existing entries are replaced on the next sync.
  • The billing card shows "Checkout abandoned", with no start or period dates.

Canceled card trials

  • A trial with a card that is canceled before converting now counts as churned and gets the churn signal ("Canceled during the trial 3 days ago").
  • It adds no MRR movement, because the trial never had MRR.
  • Autumn trials count when a processor held the subscription. Stripe trials count when a card is on file.

Signals

  • A lead whose plans all ended with no payment or card gets no more signals, apart from SLA ones.

Verified with the Autumn map, ingest and pull tests, evaluate, compute-loop, ingest, customers-rpc, and the backend and web typechecks. Main CI runs once this targets main.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1b33f18c-dd47-444b-8161-cdb11f7d5ecc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@maple-review-bot

This comment has been minimized.

@maple-review-bot maple-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 inline note from Maple's review. The score and summary are in the review comment above.

@maple-review-bot

This comment has been minimized.

@JeremyFunk JeremyFunk changed the title fix(customers): a lead whose plans ended unpaid gets no more signals fix(customers): canceled card trials churn, abandoned checkouts never started Nov 23, 2026
@maple-review-bot

This comment has been minimized.

@maple-review-bot maple-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 inline note from Maple's review. The score and summary are in the review comment above.

@maple-review-bot

maple-review-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge. The Abandoned checkout fix re-records Started and drops the abandoned event on a live read, pinned by compute-loop.test.ts:1576.
no findings · tests covered · risk medium

Autumn abandoned checkouts now read as abandoned instead of started-then-canceled, a card trial canceled before converting counts as churn with no MRR lost, and a lead whose plans all ended unpaid stops getting signals. All three behaviors are pinned by map, compute and evaluate tests.

  • abandonedCheckout marks an expired paid plan with no cancellation or billing period
  • Ingest replaces a plan's Started/Canceled events with Abandoned checkout
  • canceledCardTrial and wasCustomer count a canceled card trial as a churn
  • leftUnpaid stops non-SLA signals for a lead whose plans ended unpaid

Fixed since the last review

  • ✅ F2 · An abandoned plan that later reads live keeps its Abandoned checkout event

b7e00d3 · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@JeremyFunk
JeremyFunk merged commit 46d7a0f into fix/customers-unpaid-ended-plan Nov 24, 2026
6 checks passed
@JeremyFunk
JeremyFunk deleted the fix/customers-ended-plan-signals branch November 24, 2026 23:15
JeremyFunk added a commit that referenced this pull request Nov 24, 2026
…ted from the invoice (#632)

* fix(customers): a plan that ended on a failed payment is past due, dated from the invoice

An account whose paid plans ended was churned on the cancel date, even with its last invoice unpaid after failed attempts. It now reads past due while that invoice is open and churned from the invoice's date once it is voided or uncollectible. MRR ends at the failed invoice, existing movements and daily rows move back, and the payment-failed signal and health count it.

* fix(customers): series facts carry the unpaid invoices field

* fix(customers): unpaid ends read plan invoices only, and history is corrected on one basis

A one-off invoice no longer decides whether a plan ended unpaid. A broken movement chain leaves recorded days alone, a rebuild keeps an account's MRR until its kept churn is moved so it is not removed twice, the payment-failed signal keeps the amount before a due date, and the ended-plan invoice read is narrowed.

* fix(customers): a churn is announced once until the customer pays or resubscribes

After a churn signal closes, the same churn no longer opens another. A new one needs an invoice paid or a paid plan started before the plans' latest end. Closed churn signals are kept past retention so this holds.

* fix(customers): the history rebuild reads ended plans' invoices a chunk at a time

* test(customers): type the failed invoice fixture as an invoice op

* fix(customers): a backdated churn is announced from when the paid plan ended

* fix(customers): canceled card trials churn, abandoned checkouts never started (#642)

* fix(customers): a lead whose plans ended unpaid gets no more signals

* fix(customers): a plan that paid keeps its account evaluated

* fix(customers): a canceled card trial is a churn, an abandoned checkout never started

* fix(customers): a plan reusing an abandoned checkout's id shows as started

* test(customers): org-day fixtures drop the removed health columns
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