Skip to content

Conversation

@brandon-pereira
Copy link
Member

@brandon-pereira brandon-pereira commented Jan 15, 2026

Sometimes when generating charts, the page would crash.

image

The fix was to correct the types with the server (so server->app is strongly typed). Sever still sends no where clause, but previously frontend was typed to expect where clause.

This PR also ports some changes from ee to oss to avoid drift between the projects

Fixes HDX-3227

The fix was to correct the types with the server (so server->app is strongly typed). Sever sends no where clause, but previously frontend was typed to expect where clause.

This PR also ports some changes from ee to oss to avoid drift between the projects
@brandon-pereira brandon-pereira requested review from a team and knudtty and removed request for a team January 15, 2026 21:26
@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: 5142508

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/common-utils Patch
@hyperdx/api Patch
@hyperdx/app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview, Comment Jan 21, 2026 9:18pm

Request Review

{
onSuccess(data) {
setConfig(data);
setConfig({ ...data, where: '' });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the actual fix for the issue, but I fixed it by improving the types

@claude
Copy link

claude bot commented Jan 15, 2026

PR Review - AI Graph Explorer Type Safety Fix

Critical Issues

✅ No critical issues found.

Important Observations

Type Safety Improvements:

  • ✅ Proper schema definition with AssistantLineTableConfigSchema and AILineTableResponse
  • ✅ Correct handling of missing where clause in frontend (DBChartPage.tsx:80)
  • ✅ Better error handling with APICallError catch in router

Code Organization:

  • ✅ Good refactoring: moved logic from router to controller (getAIMetadata, getChartConfigFromResolvedConfig)
  • ✅ Proper separation of concerns between router and controller layers

Minor Observations:

  • ⚠️ Type safety: DURATIONS uses Record<string, any> (packages/api/src/controllers/ai.ts:255) - consider typing more strictly
  • ⚠️ Code duplication warning: Multiple TODO comments acknowledge duplication with frontend code (mergePath, isFieldPrimary, etc.) - acceptable for now with TODOs in place
  • ℹ️ markdown field added to schema but not used in transformation - appears intentional for future use

Schema Design:

  • ✅ Well-structured discriminated union for AssistantResponseConfig
  • ✅ Proper handling of optional fields with appropriate defaults

Recommendation

Approve - The PR successfully fixes the type mismatch bug that caused crashes. Type safety improvements are solid and error handling is appropriate.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

E2E Test Results

All tests passed • 61 passed • 4 skipped • 748s

Status Count
✅ Passed 61
❌ Failed 0
⚠️ Flaky 0
⏭️ Skipped 4

Tests ran across 4 shards in parallel.

View full report →

@kodiakhq kodiakhq bot merged commit 418828e into main Jan 21, 2026
11 of 12 checks passed
@kodiakhq kodiakhq bot deleted the brandon/fix-ai-graph-generation-type-issue branch January 21, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants