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: 3df7707

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 15, 2026 9:40pm

Review with Vercel Agent

{
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

Overall: Good refactor with proper type safety improvements

Critical Issues:

  • Missing where field in controller output (packages/api/src/controllers/ai.ts:270-294) - getChartConfigFromResolvedConfig does not set where field, frontend compensates with where empty string workaround. Add where empty string to the return object in controller instead.

Code Quality:

  • Type mismatch in schema mapping (packages/api/src/controllers/ai.ts:272-280) - AssistantLineTableConfigSchema uses different field names (aggregationFunction, property) than DerivedColumnSchema expects (aggFn, valueExpression). While mapping works, consider documenting this intentional schema divergence.
  • Hardcoded model version (packages/api/src/controllers/ai.ts:29) - claude-opus-4-5-20251101 is hardcoded. Consider moving to config for easier updates.

Minor:

  • Frontend workaround still needed (packages/app/src/DBChartPage.tsx:80) - setConfig with where empty string should not be necessary if backend returns complete type. Fix in backend (see first issue).

Notes:

  • Good separation of concerns with new controller layer
  • Proper error handling for AI API failures
  • Type safety improvement fixes the crash mentioned in PR description

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

E2E Test Results

All tests passed • 59 passed • 4 skipped • 743s

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

Tests ran across 4 shards in parallel.

View full report →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants