Skip to content

Commit 1e39e13

Browse files
Fix bug where generated URLs default to live tail (#1326)
This was originally prevented by this useEffect: https://github.com/hyperdxio/hyperdx/pull/1305/files#diff-6a2491347ca591776e19bf42f3b0f76b4fb6ba15f6e70e697d45c30218997b69L739 but I think having logic to deviate from the URL causing a lot of complexity in this page, so I personally think we should work towards making the URL the source of truth for the state instead. Original Bug Reproduction: 1. Increase time range beyond default live tail duration 2. Click on a histogram bar and then click "View Events" 3. Note that the time range is updated 4. Wait a few seconds and the time range will be incorrectly reverted back to the default live tailing date range Fix: 1. Do reproduction steps as above 2. At step 4, see that URL is displayed as intended. Fixes HDX-2718
1 parent 6e628bc commit 1e39e13

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.changeset/loud-spiders-share.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
Fix bug with generating search urls

packages/app/src/DBSearchPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,11 +1108,14 @@ function DBSearchPage() {
11081108
to: searchedTimeRange[1].getTime().toString(),
11091109
select: searchedConfig.select || '',
11101110
source: searchedSource?.id || '',
1111-
filters: JSON.stringify(searchedConfig.filters),
1111+
filters: JSON.stringify(searchedConfig.filters ?? []),
1112+
isLive: 'false',
1113+
liveInterval: interval.toString(),
11121114
});
11131115
return `/search?${qParams.toString()}`;
11141116
},
11151117
[
1118+
interval,
11161119
searchedConfig.filters,
11171120
searchedConfig.select,
11181121
searchedConfig.where,

packages/app/src/components/DBTimeChart.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ function DBTimeChartComponent({
174174
source: (isMetricChart ? source?.logSourceId : source?.id) ?? '',
175175
where: where,
176176
whereLanguage: whereLanguage,
177-
filters: JSON.stringify(config.filters),
177+
filters: JSON.stringify(config.filters ?? []),
178+
isLive: 'false',
178179
from: from.toString(),
179180
to: to.toString(),
180181
};

0 commit comments

Comments
 (0)