Repository navigation
fix: restore plan usage and isolate self-hosted billing - #609
Merged
Merged
Conversation
Reviewer's GuideThe PR restores local workspace usage routing and Plan rendering, removes unsupported Vault pricing artifacts, and establishes a defense-in-depth hosting policy that prevents all billing HTTP traffic and UI access until official cloud hosting is confirmed, while leaving self-hosted Pro features available. Sequence diagram for hosting-guarded billing requestssequenceDiagram
participant UI as Web client
participant Policy as getWorkspacePlanPolicy
participant Billing as Billing API
participant Server as Hosted billing server
UI->>Billing: getPricingCatalog()
Billing->>Policy: getWorkspacePlanPolicy()
alt Official cloud hosting
Policy-->>Billing: usesHostedBilling = true
Billing->>Server: GET /billing/api/v1/pricing
Server-->>UI: PricingCatalog
else Self-hosted or unresolved server
Policy-->>Billing: usesHostedBilling = false
Billing-->>UI: Error: Hosted billing is not available
end
Flow diagram for hosted-only Plan and Billing UIflowchart TD
Start[Load Plan, Billing, or upgrade UI] --> Hosted{"useIsOfficialHosted()"}
Hosted -->|Yes| Load[Load pricing, subscription, and usage data]
Load --> Render[Render Plan/Billing UI and upgrade actions]
Hosted -->|No| Hide[Hide billing UI and skip requests]
Hide --> Pro[Self-hosted Pro features remain available]
DeepLink[Direct upgrade or Plan deep link] --> Hosted
Flow diagram for local workspace usage proxy routingflowchart TD
Request["/api/workspace/{workspaceId}/usage-and-limit"] --> Mode{Vite command}
Mode -->|serve| Target{Explicit API target?}
Target -->|Yes| Explicit[Configured API target]
Target -->|No| Gateway[Local gateway: http://localhost:8100]
Mode -->|build| None[No local development proxy]
Explicit --> Usage[Workspace usage response]
Gateway --> Usage
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
appflowy
marked this pull request as ready for review
October 7, 2026 03:31
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.
Description
When Vite starts before the local gateway, workspace usage can be routed to Cloud, which does not implement that endpoint. Keep local
usage-and-limitrequests on the gateway so Plan usage and both Pro upgrade toggles render correctly. Match the usage-track colors to desktop.Require confirmed cloud hosting before any billing HTTP request. Pricing and workspace billing hooks, settings panels, and upgrade dialogs remain disabled for self-hosted or unresolved servers, including retries and direct deep links. Self-hosted access to Pro features is preserved.
Vault Workspace is no longer supported. Remove obsolete Vault pricing metadata, labels, and Storybook fixtures. The Web client has no Vault add-on UI or personal-subscription status/checkout APIs; generic tests still verify that unsupported account add-ons are excluded from workspace plans and checkout.
The proxy change applies only to local development. Hosting guards and UI changes apply to production builds when released.
Use a normal Playwright click for BDD slash-menu selection and wait for the menu to close. This prevents the click from racing the popover animation, which also caused flaky simple-table setup on
main.Validation
pnpm type-check, ESLint on changed application/configuration files, andgit diff --checkpassed.Checklist
General
Testing
Feature-Specific
Summary by Sourcery
Restore workspace plan usage in local development and isolate hosted billing from self-hosted or unconfirmed servers while removing unsupported Vault Workspace support.
Bug Fixes:
Enhancements:
Build:
Tests: