fix: analytics group-by chart rendering and error display#492
fix: analytics group-by chart rendering and error display#492izadoesdev wants to merge 7 commits intouseautumn:devfrom
Conversation
|
@izadoesdev is attempting to deploy a commit to the Autumn Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Additional Comments (5)
-
vite/src/views/customers/customer/analytics/components/QueryTopbar.tsx, line 5 (link)style: Using deprecated UI component instead of v2
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
vite/src/views/customers/customer/analytics/AnalyticsView.tsx, line 123-130 (link)style: Debug console.log should be removed before production
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
server/src/internal/analytics/AnalyticsService.ts, line 345 (link)style: Empty catch block silently swallows all errors. Consider logging the error or being more specific about which errors should trigger the fallback. Should we log the materialized view failure for debugging purposes, or is the silent fallback intentional to avoid noise?
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
-
vite/src/views/customers/customer/analytics/ViewUserEvents.tsx, line 14 (link)style: Remove console.log statement - debug code should not be committed to production
-
vite/src/views/customers/customer/analytics/ViewUserEvents.tsx, line 24-28 (link)logic: Dialog contains placeholder content unrelated to analytics - should either be implemented properly or removed if not ready. Is this component intended to be part of this analytics fix PR, or was it included by mistake?
12 files reviewed, 5 comments
Summary
Fixes chart rendering when grouping analytics by properties and improves error messaging for invalid group-by selections.
Changes
version). The backend returns data without ametaproperty, so we now build it from data keys when needed.Technical Details
transformGroupedDataandgenerateChartConfigto handle missingmetaproperty by building it from the first data rowAnalyticsViewforInvalidInputserrors related to group-by validationgroupByandrefreshAnalyticsfeaturesTesting
Greptile Summary
metaproperty optional and building it from data keys when the backend doesn't provide itevents_usage_mvmaterialized view in ClickHouse for improved analytics query performance with try-catch fallback to existing queriesImportant Files Changed
server/src/internal/analytics/AnalyticsService.tsvite/src/views/customers/customer/analytics/utils/transformGroupedChartData.tsvite/src/views/customers/customer/analytics/AnalyticsView.tsxserver/src/external/clickhouse/ClickHouseManager.tsvite/src/views/customers/customer/analytics/ViewUserEvents.tsxConfidence score: 3/5
AnalyticsView.tsx), placeholder/unfinished component (ViewUserEvents.tsxwith hardcoded text and debug output), and complex database query refactoring without comprehensive error handlingViewUserEvents.tsxwhich contains obvious development artifacts, andAnalyticsView.tsxwhich has debug logging that should be removed before productionSequence Diagram
sequenceDiagram participant User participant AnalyticsView participant AnalyticsService participant ClickHouse participant ChartUtils User->>AnalyticsView: "Load analytics with group_by parameter" AnalyticsView->>AnalyticsService: "getTimeseriesEvents with groupBy" alt ClickHouse available AnalyticsService->>ClickHouse: "Query events with group by properties" ClickHouse-->>AnalyticsService: "Raw grouped event data" else ClickHouse disabled AnalyticsService-->>AnalyticsView: "ClickHouse disabled error" end alt Valid group-by property AnalyticsService-->>AnalyticsView: "Events data without meta property" AnalyticsView->>ChartUtils: "transformGroupedData(events, groupBy)" ChartUtils->>ChartUtils: "Build meta from data keys if missing" ChartUtils->>ChartUtils: "Pivot data by group values" ChartUtils-->>AnalyticsView: "Transformed chart data" AnalyticsView->>ChartUtils: "generateChartConfig(events, features, groupBy)" ChartUtils-->>AnalyticsView: "Chart configuration with colors" AnalyticsView->>User: "Display chart with grouped data" else Invalid group-by (high cardinality) AnalyticsService-->>AnalyticsView: "InvalidInputs error" AnalyticsView->>User: "Show specific error message for group-by validation" endContext used:
dashboard- CLAUDE.md (source)