{"record":{"id":"d0ca34d490aa9389","repo":"OtterMind/Chat2DB","slug":"pricing-is-disabled-in-community-mode","errorCode":null,"errorMessage":"Pricing is disabled in community mode","messagePattern":"Pricing is disabled in community mode","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"chat2db-community-client/src/community-stubs/service/pricing.ts","lineNumber":4,"sourceCode":"const pricingServices = {\n  getProductList: async () => [],\n  createOrder: async () => {\n    throw new Error('Pricing is disabled in community mode');\n  },\n  getOrder: async () => {\n    throw new Error('Pricing is disabled in community mode');\n  },\n  getOrderList: async () => [],\n  cancelSubscription: async () => undefined,\n};\n\nexport default pricingServices;\n","sourceCodeStart":1,"sourceCodeEnd":14,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-client/src/community-stubs/service/pricing.ts#L1-L14","documentation":"The community-mode pricing stub throws when createOrder() is called. The Community edition has no billing/payment integration, so the stub returns empty data for read methods (getProductList, getOrderList) but throws for transactional methods (createOrder, getOrder) to prevent any accidental order flow. This is a deliberate product-contract boundary, not a bug.","triggerScenarios":"Calling pricingServices.createOrder() in a Community build — e.g., a pricing/billing modal that was not fully hidden, or a redirect to a checkout flow that invokes createOrder before checking edition.","commonSituations":"A shared upgrade/billing button rendered in Community without edition gating. Refactoring pricing UI but forgetting to stub-test the order creation path. Environments mislabeled so Community code loads Enterprise pricing handlers.","solutions":["Hide or disable the order/checkout UI in Community builds using the runtime edition helper.","Guard createOrder calls: if (__RUNTIME_ENV__ === 'community') return; before invoking it.","Audit all createOrder call sites and ensure each is behind an Enterprise-only feature gate."],"exampleFix":"// before\nawait pricingServices.createOrder({ id, seats });\n\n// after\nif (__RUNTIME_ENV__ !== 'community') {\n  await pricingServices.createOrder({ id, seats });\n}","handlingStrategy":"validation","validationCode":"function isPricingEnabled(): boolean {\n  return __RUNTIME_ENV__ !== 'community';\n}\n\nif (isPricingEnabled()) {\n  await pricingServices.createOrder(params);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Hide billing/upgrade UI in Community via conditional rendering on edition.","Audit all createOrder call sites during Community build review.","Add a lint rule or codemod to flag createOrder calls without edition guards."],"tags":["community-mode","pricing","billing","feature-flag","frontend"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}