Browse Source

fix(browser-starfish): render blocking all searches for only blocking (#60549)

Something we missed here, for some reason when no render blocking was
selected, we defaulted to `All`.

This also fixes a bug where the resource module widget shows everything
that isn't blocking, which is the opposite of what we wanted.

We should have be defaulting to any blocking status.
Dominik Buszowiecki 1 year ago
parent
commit
5c4bae66d9

+ 1 - 1
static/app/views/performance/browser/resources/utils/useResourcesQuery.ts

@@ -51,7 +51,7 @@ export const getResourcesEventViewQuery = (
       ? [
           `${RESOURCE_RENDER_BLOCKING_STATUS}:${resourceFilters[RESOURCE_RENDER_BLOCKING_STATUS]}`,
         ]
-      : [`!${RESOURCE_RENDER_BLOCKING_STATUS}:blocking`]),
+      : []),
     'AND (',
     ...getResourceTypeFilter(resourceFilters[SPAN_OP], defaultResourceTypes),
     ')',

+ 1 - 1
static/app/views/performance/landing/widgets/components/widgetContainer.spec.tsx

@@ -925,7 +925,7 @@ describe('Performance > Widgets > WidgetContainer', function () {
           per_page: QUERY_LIMIT_PARAM,
           project: ['-42'],
           query:
-            '!span.description:browser-extension://* !resource.render_blocking_status:blocking AND ( span.op:resource.script OR file_extension:css OR file_extension:[woff,woff2,ttf,otf,eot] ) transaction.op:pageload',
+            '!span.description:browser-extension://* resource.render_blocking_status:blocking AND ( span.op:resource.script OR file_extension:css OR file_extension:[woff,woff2,ttf,otf,eot] ) transaction.op:pageload',
           sort: '-time_spent_percentage()',
           statsPeriod: '7d',
         }),

+ 1 - 3
static/app/views/performance/landing/widgets/widgets/lineChartListWidget.tsx

@@ -23,7 +23,6 @@ import {MutableSearch} from 'sentry/utils/tokenizeSearch';
 import {useLocation} from 'sentry/utils/useLocation';
 import withApi from 'sentry/utils/withApi';
 import {DEFAULT_RESOURCE_TYPES} from 'sentry/views/performance/browser/resources/jsCssView';
-import {useResourceModuleFilters} from 'sentry/views/performance/browser/resources/utils/useResourceFilters';
 import {getResourcesEventViewQuery} from 'sentry/views/performance/browser/resources/utils/useResourcesQuery';
 import DurationChart from 'sentry/views/performance/charts/chart';
 import {transactionSummaryRouteWithQuery} from 'sentry/views/performance/transactionSummary/utils';
@@ -89,7 +88,6 @@ export function LineChartListWidget(props: PerformanceWidgetProps) {
   const [selectedListIndex, setSelectListIndex] = useState<number>(0);
   const {ContainerActions, organization, InteractiveTitle} = props;
   const pageError = usePageError();
-  const resourceFilters = useResourceModuleFilters();
   const canHaveIntegrationEmptyState = integrationEmptyStateWidgets.includes(
     props.chartSetting
   );
@@ -204,7 +202,7 @@ export function LineChartListWidget(props: PerformanceWidgetProps) {
           eventView.additionalConditions.removeFilter('event.type');
           eventView.additionalConditions.removeFilter('time_spent_percentage()');
           eventView.query = `${mutableSearch.formatString()} ${getResourcesEventViewQuery(
-            resourceFilters,
+            {'resource.render_blocking_status': 'blocking'},
             DEFAULT_RESOURCE_TYPES
           ).join(' ')}`;
         } else if (isSlowestType || isFramesType) {