🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Refactor configuration and telemetry service
Bill Yang1f12eb3afbc7
diff --git a/client/src/lib/subscription/useStripeSubscription.ts b/client/src/lib/subscription/useStripeSubscription.tsindex 6cf81407d..45c6f0720 100644--- a/client/src/lib/subscription/useStripeSubscription.ts+++ b/client/src/lib/subscription/useStripeSubscription.ts@@ -1,6 +1,6 @@import { useQuery } from "@tanstack/react-query";import { authClient } from "@/lib/auth";-import { BACKEND_URL } from "../const";+import { BACKEND_URL, IS_CLOUD } from "../const";interface SubscriptionData {id: string;@@ -24,7 +24,7 @@ export function useStripeSubscription() {const { data: activeOrg } = authClient.useActiveOrganization();const fetchSubscription = async () => {- if (!activeOrg) {+ if (!activeOrg || !IS_CLOUD) {return null;}diff --git a/docker-compose.yml b/docker-compose.ymlindex 24daa34ab..629691487 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -120,7 +120,6 @@ services:volumes:clickhouse-data:postgres-data:- redis-data:caddy_data: # Persistent volume for Caddy's certificates and statecaddy_config: # Persistent volume for Caddy's configuration cache (optional but good practice)diff --git a/server/src/services/telemetryService.ts b/server/src/services/telemetryService.tsindex efd0768fe..9fea1d4c0 100644--- a/server/src/services/telemetryService.ts+++ b/server/src/services/telemetryService.ts@@ -55,7 +55,7 @@ class TelemetryService {// Get table row counts from ClickHouseprivate async getTableCounts() {- const tables = ["events", "session_replay_events", "session_replay_metadata", "hourly_events_by_site_mv_target"];+ const tables = ["events", "session_replay_events", "session_replay_metadata"];const counts: Record<string, number> = {};@@ -68,7 +68,7 @@ class TelemetryService {const data = await processResults<{ count: number }>(result);counts[table] = data[0]?.count || 0;} catch (error) {- // Table might not exist, especially hourly_events_by_site_mv_target in self-hosted+ // Table might not existcounts[table] = 0;}}