chore(billing): delete the dead seat-based billing feature#3507
Merged
Conversation
|
😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
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
adboio
force-pushed
the
posthog-code/delete-seat-billing
branch
from
July 16, 2026 18:06
017ed7e to
b2e2375
Compare
adboio
marked this pull request as ready for review
July 16, 2026 18:15
Contributor
|
Reviews (1): Last reviewed commit: "chore(billing): delete the dead seat-bas..." | Re-trigger Greptile |
charlesvien
approved these changes
Jul 16, 2026
The UI usage-cache clear keyed on authIdentity (region + project), but usage is org-scoped — the host UsageMonitorService keys its snapshot on currentOrgId. Switching between two orgs that both have no selected project leaves authIdentity at "region:none", so the effect never re-ran and a failed post-switch refresh could leave the previous org's spend cached. Depend on currentOrgId too, matching the host. Addresses the Greptile P1 review comment on #3507. Generated-By: PostHog Code Task-Id: 90f5b50d-504e-433d-82d9-2b9ead0bb1e5
Contributor
Author
|
/trunk merge |
Contributor
Author
Merge activity
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.
shared/seat.ts(SeatData, plan keys), coreseatService/seatView/seatErrors+ DI tokens + module, UIseatStore/seatClient/useSeat(already had zero importers), the five/api/seats/*api-client methods and both seat error classes, and their tests.LlmGatewayService.invalidatePlanCache, endpoint member, URL helper) — its only caller was the seat upgrade flow.SUBSCRIPTION_STARTED/SUBSCRIPTION_CANCELLEDevents and the"upgrade_dialog"surface literal nothing emits anymore. The liveUPGRADE_PROMPT_*events are untouched.llmGatewayquery invalidation; onboarding's org switch drops its seat fetch;BILLING_FLAGitself stays (it gates the live billing UI).How did you test this?
pnpm typecheck— all 23 packages passpnpm exec biome ci .— clean (3528 files)shared,core,ui,api-client,host-router,agentutils). The@posthog/agentserver /@posthog/git/@posthog/workspace-serversuites and the@posthog/ditoken scan fail in this sandbox for pre-existing environmental reasons (the sandbox blocks the plaingit committheir fixtures use; the di repo-scan times out under parallel load) — unrelated to this diff, and identical onmainhere.node scripts/check-host-boundaries.mjs— no new violationsbiome lint packages/core— zeronoRestrictedImportsAutomatic notifications
Created with PostHog Code