Skip to content

Fix account.me test broken by Stack billing removal merge race - #7803

Closed
austinywang wants to merge 1 commit into
mainfrom
fix-account-me-test-stripe-billing
Closed

austinywang wants to merge 1 commit into
mainfrom
fix-account-me-test-stripe-billing

Conversation

@austinywang

@austinywang austinywang commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Main CI is red: web-typecheck fails on every completed run since 25b5fd8 with:

tests/account-me-orpc.test.ts(8,10): error TS2305: Module '../services/billing/pro' has no exported member 'PRO_PRODUCT_ID'.

Root cause: merge race

Both PRs were green pre-merge against bases that lacked the other; the post-merge CI runs on main were cancelled by newer pushes (concurrency), so the first completed run to surface the break was 25b5fd8. Every CI run on main since then fails web-typecheck, which cascades into the tests, linux-preflight, and ci-status gates.

Fix

Rework the test to the post-#7662 Stripe-backed billing model, keeping the DB-free property:

  • Procedure-level Free coverage: id-less fake users short-circuit the Stripe subscription lookup, asserting the full {userId, email, planId, isPro, billingManagement: "none"} shape.
  • Pro coverage moves to resolveProPlanStatus directly with an injected hasActiveStripeSubscription (the procedure no longer exposes an injection point), asserting billingManagement: "stripe" and the read-time cmuxPlan: "pro" metadata sync.
  • Unauthenticated, OpenAPI advertisement, and spec byte-parity tests unchanged.

Verification

  • bun run typecheck in web/: clean.
  • Full CI-order suite: 565 pass, 0 fail.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
Test-only changes; no production billing or API behavior modified.

Overview
Repairs web/tests/account-me-orpc.test.ts after main dropped Stack product billing (PRO_PRODUCT_ID and billingManagement: "external").

The test no longer fakes Stack product lists. Free plan behavior is asserted via accountMeProcedure with id-less users that skip Stripe lookups and return billingManagement: "none". Pro is covered by calling resolveProPlanStatus with an injected hasActiveStripeSubscription, expecting billingManagement: "stripe" and a Stack metadata sync cmuxPlan: "pro". Auth rejection, OpenAPI, and checked-in spec parity tests are unchanged.

Reviewed by Cursor Bugbot for commit 3f51fa1. Bugbot is set up for automated code reviews on this repo. Configure here.


Summary by cubic

Fixes CI by updating the account.me test to the Stripe-backed billing model after Stack product billing was removed. Restores green web typecheck and keeps tests DB-free.

  • Bug Fixes
    • Replaced Stack product check with Stripe plan resolution; Free path uses id-less fake users and asserts billingManagement: "none".
    • Added direct resolveProPlanStatus test with injected hasActiveStripeSubscription, asserting billingManagement: "stripe" and cmuxPlan: "pro" metadata sync.
    • Left unauthenticated, OpenAPI advertisement, and spec parity tests unchanged.

Written for commit 3f51fa1. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Tests
    • Added coverage for determining Pro-plan status from an active Stripe subscription.
    • Verified plan metadata and account updates are reconciled correctly.
    • Updated account scenarios to confirm users without Stripe subscriptions or email addresses remain on the Free plan.

PR #7662 removed Stack product billing (and the PRO_PRODUCT_ID export) while PR #7757 added this test against pre-#7662 main; both were green pre-merge but their post-merge CI runs were cancelled by newer pushes, so main web-typecheck broke. Rework the test to the Stripe-backed model: id-less fake users resolve Free without a database, and the Pro path drives resolveProPlanStatus with an injected subscription query, asserting stripe billing management and the cmuxPlan metadata sync.
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Building Building Preview, Comment Jul 10, 2026 4:12am
cmux-staging Building Building Preview, Comment Jul 10, 2026 4:12am

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cfd91837-2615-45ca-b198-f0d909228220

📥 Commits

Reviewing files that changed from the base of the PR and between 35a42b7 and 3f51fa1.

📒 Files selected for processing (1)
  • web/tests/account-me-orpc.test.ts

📝 Walkthrough

Walkthrough

The account tests simplify user fixtures, add Free-account coverage, and directly test Stripe-backed resolveProPlanStatus behavior, including Pro metadata and reconciliation through user.update.

Changes

Pro plan status tests

Layer / File(s) Summary
Account and Pro-plan resolution coverage
web/tests/account-me-orpc.test.ts
The tests simplify fake-user setup, cover Free results for users without Stripe subscriptions and email-less users, and verify Stripe-backed Pro metadata with reconciliation write-back.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

  • manaflow-ai/cmux#7443 — Both changes exercise Pro-status resolution used for billing-management behavior.
  • manaflow-ai/cmux#7448 — Both changes rely on resolveProPlanStatus for Pro and Free plan states.
  • manaflow-ai/cmux#7479 — Both changes cover billingManagement classification through Pro-plan status resolution.
🚥 Pre-merge checks | ✅ 25
✅ Passed checks (25 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: fixing the account.me test after Stack billing removal.
Description check ✅ Passed Covers the summary and verification clearly, though it omits the demo video, review trigger block, and checklist items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed Diff only changes a TypeScript test; no Swift files or actor-isolation-sensitive production code are modified.
Cmux Swift Blocking Runtime ✅ Passed Diff changes only a TypeScript test file; no Swift code or runtime-sync patterns were introduced.
Cmux Browser Automation Off-Main ✅ Passed Only web/tests/account-me-orpc.test.ts changed; no browser.* router/worker/WebKit automation code or policy tests were touched.
Cmux Expensive Synchronous Load ✅ Passed Diff changes only web/tests/account-me-orpc.test.ts; no Swift or main-actor agent-history loads were introduced.
Cmux Cache Substitution Correctness ✅ Passed Diff is test-only; no production persistence/history/snapshot path swapped a fresh read for cached data, so the cache-substitution rule isn’t implicated.
Cmux No Hacky Sleeps ✅ Passed The diff is test-only and introduces no sleeps, timers, polling, or wall-clock waits; it uses direct injection instead.
Cmux Algorithmic Complexity ✅ Passed PASS: The only changed file is a test, and its only collection loop is over a fixed two-item spec list, which the rule explicitly allows.
Cmux Swift Concurrency ✅ Passed Diff changes only web/tests/account-me-orpc.test.ts; no Swift files or concurrency patterns were introduced.
Cmux Swift @Concurrent ✅ Passed No Swift files changed; the PR only touches a TypeScript test, so the Swift concurrent-annotation rule is not applicable.
Cmux Swift File And Package Boundaries ✅ Passed No Swift files or package-boundary-sensitive changes are in the diff; only a TypeScript test changed, so the Swift rule is inapplicable.
Cmux Swiftpm Lockfiles ✅ Passed PR diff only changes web/tests/account-me-orpc.test.ts; no Package.swift, Package.resolved, .gitignore, workflow, or Xcode project files are touched.
Cmux Swift Logging ✅ Passed No Swift files changed; the diff only touches a web test, so the Swift logging rules are not applicable.
Cmux User-Facing Error Privacy ✅ Passed Only a test file changed, and the rule explicitly allows tests; no user-facing errors or copy were added.
Cmux Full Internationalization ✅ Passed Only web/tests/account-me-orpc.test.ts changed, and the i18n rule explicitly allows tests as non-user-facing.
Cmux Swiftui State Layout ✅ Passed Diff only changes web/tests/account-me-orpc.test.ts; no SwiftUI views, state, GeometryReader, or render-time mutations were introduced.
Cmux Architecture Rethink ✅ Passed Only a TypeScript test changed; no Swift architecture code or lifecycle wiring is involved, so the rule does not apply.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: Diff only touches a web test; no Swift window code, cmux.* identifiers, or cmuxAuxiliaryWindowIdentifiers changes are present.
Cmux Source Artifacts ✅ Passed The only changed path is a hand-written test file; no logs, caches, screenshots, temp dirs, or other source artifacts were added.
Cmux No Test Or Debug Seam In Production Source ✅ Passed PR changes only web/tests/account-me-orpc.test.ts; no Swift production Sources/ files were modified, so the rule is not applicable.
Cmux No Ambient Global State ✅ Passed The commit only changes web/tests/account-me-orpc.test.ts; no Swift files or production global-state patterns are touched.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-account-me-test-stripe-billing

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

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the account billing tests for the Stripe-backed plan model.

  • Removes the stale Stack product billing import.
  • Changes account.me procedure coverage to assert Free plan output.
  • Adds direct resolver coverage for active Stripe subscriptions and metadata sync.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
web/tests/account-me-orpc.test.ts Reworks the account billing tests to avoid the removed Stack product export and assert the current Stripe-backed resolver behavior.

Reviews (1): Last reviewed commit: "Fix account.me test after Stack billing ..." | Re-trigger Greptile

This branch was successfully deployed

1 active deployment
Preview – cmux — 3f51fa1b Deployed Jul 10, 2026 by vercel[bot]
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