fix: don't wrap JSON filters in "toString" until query rendering#2344
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: eb4abf0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
|
<!-- deep-review --> Deep Review✅ No critical issues found. 🟡 P2 -- recommended
Reviewers (4): correctness, testing, maintainability, kieran-typescript. Testing gaps:
|
E2E Test Results✅ All tests passed • 191 passed • 3 skipped • 1171s
Tests ran across 4 shards in parallel. |
Resolved one conflict in `packages/app/src/components/DBRowJsonViewer.tsx`. Origin: PR #2401 (rollback of #2344) restored the `isJsonColumn` declaration and the `toString(...)` filter-wrapping logic that #2344 had removed. My branch was based on a main that included #2344, so my HEAD had neither `isJsonColumn` nor the toString wrapping. The merge produced a conflict at the `mergePath(...)` line because both sides modified the same hunk: my side added `mapColumns` as the third argument; main's side added back the `isJsonColumn` declaration. Resolution: union both. Keep `mergePath(keyPath, jsonColumns, mapColumns)` (HDX-4369 fix) and restore `const isJsonColumn = keyPath.length > 0 && jsonColumns?.includes(keyPath[0]);` so the four toString call sites that main brought back compile and behave as on main. Verified the HDX-4369 fix did not drift: - mergePath suite (6 cases) green: numeric Map sub-key still emits Map['1'], not Map[2]; escape rules preserved; JSON-vs-Map precedence unchanged. - buildJSONExtractQuery suite (4 cases) green: parsed-JSON Map sub-key still emits JSONExtractString(LogAttributes['1'], 'foo'). - deriveMapColumnsFromFields, getMapColumnNames, useMapColumns suites green; all mapColumns threading sites intact. - 469 tests passed across 15 suites (all five files my PR touched plus neighbors). - yarn workspace @hyperdx/app tsc --noEmit clean. - yarn workspace @hyperdx/common-utils run build clean. - yarn lint:fix clean (0 errors).
Summary
After changing filters to emit Lucene instead of SQL, JSON columns were trying to add "toString(Column.key)" as lucene, which is invalid syntax and broke things. That issue has been fixed.