Skip to content

chore(billing): delete the dead seat-based billing feature#3507

Draft
adboio wants to merge 1 commit into
mainfrom
posthog-code/delete-seat-billing
Draft

chore(billing): delete the dead seat-based billing feature#3507
adboio wants to merge 1 commit into
mainfrom
posthog-code/delete-seat-billing

Conversation

@adboio

@adboio adboio commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

The usage-based billing cutover has fully shipped (#3485#3487#3488) and the backend migration off seats is underway. The entire seat-based model — per-user seats, auto-provisioning, upgrade/cancel/reactivate flows — is now dead code in the client: nothing renders it, and keeping it around invites confusion with the live usage-billing surfaces sitting in the same directories.

Changes

Pure deletion plus the surgical unhooking around it; no behavior change to the live usage-billing surfaces.

  • Deleted the seat feature: shared/seat.ts (SeatData, plan keys), core seatService/seatView/seatErrors + DI tokens + module, UI seatStore/seatClient/useSeat (already had zero importers), the five /api/seats/* api-client methods and both seat error classes, and their tests.
  • Deleted the gateway invalidate-plan-cache chain (tRPC procedure, LlmGatewayService.invalidatePlanCache, endpoint member, URL helper) — its only caller was the seat upgrade flow.
  • Removed orphaned analytics: SUBSCRIPTION_STARTED/SUBSCRIPTION_CANCELLED events and the "upgrade_dialog" surface literal nothing emits anymore. The live UPGRADE_PROMPT_* events are untouched.
  • Unhooked call sites: auth session sync keeps its identity-scoped usage-cache clear (still load-bearing) but drops the seat fetch and a no-op llmGateway query invalidation; onboarding's org switch drops its seat fetch; BILLING_FLAG itself stays (it gates the live billing UI).

How did you test this?

  • pnpm typecheck — all 23 packages pass
  • pnpm exec biome ci . — clean (3528 files)
  • Unit tests for all touched packages pass (shared, core, ui, api-client, host-router, agent utils). The @posthog/agent server / @posthog/git / @posthog/workspace-server suites and the @posthog/di token scan fail in this sandbox for pre-existing environmental reasons (the sandbox blocks the plain git commit their fixtures use; the di repo-scan times out under parallel load) — unrelated to this diff, and identical on main here.
  • node scripts/check-host-boundaries.mjs — no new violations
  • biome lint packages/core — zero noRestrictedImports

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

The usage-based billing cutover shipped (#3485, #3487, #3488) and the
seat model is dead code: nothing rendered useSeat, the seat store was
only fed by auth/onboarding sync calls, and the /api/seats/* client
methods have no remaining product surface.

Removed: shared seat types/plan keys, core SeatService/seatView/
seatErrors + tokens, the UI seat store/client/hook, api-client seat
methods and seat error classes, the SUBSCRIPTION_STARTED/CANCELLED
analytics events, the orphaned "upgrade_dialog" surface literal, and
the gateway invalidate-plan-cache chain (router procedure, service
method, endpoint, URL helper) whose only caller was the seat upgrade
flow.

Auth identity sync keeps the usage-snapshot cache clear (still
load-bearing for usage billing); the llmGateway query invalidation it
carried was a no-op (no queries live under that key) and is dropped.

Generated-By: PostHog Code
Task-Id: 1039ea23-9930-44e2-9888-b05cf8b129ec
@trunk-io

trunk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 017ed7e.

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