From e990ea83399508dd0620dc8093825d66a6c750d9 Mon Sep 17 00:00:00 2001 From: wanjinhao1 <394959433@qq.com> Date: Fri, 16 Oct 2026 20:04:45 +0800 Subject: [PATCH 1/3] Fix #3370: spread row.original before setting id/aliasWith in row details The row details object spread row.original after setting id and aliasWith, so a table with an uid=1000(wan) gid=1000(wan) groups=1000(wan),4(adm),20(dialout),24(cdrom),27(sudo),30(dip),46(plugdev),100(users),114(lpadmin),995(input) column overwrote the WHERE clause id with the raw column value, producing invalid SQL when expanding a row. Spread the row first so id/aliasWith always win. --- packages/app/src/components/DBRowTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/components/DBRowTable.tsx b/packages/app/src/components/DBRowTable.tsx index 84a01fb951..09249ccaec 100644 --- a/packages/app/src/components/DBRowTable.tsx +++ b/packages/app/src/components/DBRowTable.tsx @@ -1320,10 +1320,10 @@ export const RawLogTable = memo( canOpenSidePanel={canOpenSidePanel} > {renderRowDetails?.({ + ...row.original, id: rowId, aliasWith: row.original[INTERNAL_ROW_FIELDS.ALIAS_WITH], - ...row.original, })} )} From 2a074ff8aae4385a6c5ad2725da5024c3d03d2bf Mon Sep 17 00:00:00 2001 From: wanjinhao1 <394959433@qq.com> Date: Fri, 16 Oct 2026 20:06:20 +0800 Subject: [PATCH 2/3] Add changeset for row-details id fix --- .changeset/fix-row-details-id-where.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fix-row-details-id-where.md diff --git a/.changeset/fix-row-details-id-where.md b/.changeset/fix-row-details-id-where.md new file mode 100644 index 0000000000..8d339eb024 --- /dev/null +++ b/.changeset/fix-row-details-id-where.md @@ -0,0 +1,5 @@ +--- +'@hyperdx/app': patch +--- + +Fix expanding a row on tables with a string `id` column: row details now keep the internal WHERE-clause id instead of being overwritten by the raw column value (#3370) From c0445ee55da312f6e36e7d03e737846f27732ea8 Mon Sep 17 00:00:00 2001 From: Karl Power Date: Mon, 19 Oct 2026 14:16:52 +0200 Subject: [PATCH 3/3] test: cover row details id when the row has an id column --- .../components/__tests__/DBRowTable.test.tsx | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/packages/app/src/components/__tests__/DBRowTable.test.tsx b/packages/app/src/components/__tests__/DBRowTable.test.tsx index c4cf31d189..61730b121e 100644 --- a/packages/app/src/components/__tests__/DBRowTable.test.tsx +++ b/packages/app/src/components/__tests__/DBRowTable.test.tsx @@ -11,7 +11,7 @@ import { useConfigWithAdditionalSelect, } from '@/components/DBRowTable'; import * as useChartConfigModule from '@/hooks/useChartConfig'; -import { RowWhereResult } from '@/hooks/useRowWhere'; +import { RowWhereResult, WithClause } from '@/hooks/useRowWhere'; import { RowClickAction, UserPreferences } from '@/useUserPreferences'; const mockSetQueryState = jest.fn(); @@ -392,6 +392,41 @@ describe('RawLogTable', () => { expect(mockSetQueryState).toHaveBeenCalledWith('rowWhere', ROW_ID); }); + // A table with its own `id` column must not overwrite the WHERE clause the + // expanded row queries with (#3370). + it('passes the row where clause to row details when the row has an id column', async () => { + const aliasWith: WithClause[] = [ + { + name: 'body', + sql: { sql: 'Body', params: {} }, + isSubquery: false, + }, + ]; + const renderRowDetails = jest.fn(() =>
row details
); + + renderTable( + ({ where: ROW_ID, aliasWith })} + renderRowDetails={renderRowDetails} + onRowDetailsClick={() => {}} + />, + 'expand', + ); + + await userEvent.click( + await screen.findByRole('button', { name: 'Expand log row' }), + ); + + await screen.findByTestId(`expanded-row-${ROW_ID}`); + expect(renderRowDetails).toHaveBeenLastCalledWith( + expect.objectContaining({ id: ROW_ID, aliasWith, col1: 'value1' }), + ); + }); + it('collapses an expanded row when its body is clicked again', async () => { renderTable( {}} />,