Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Fix] App Analytics Log Events Crash Fix #2030

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/components/event_analytics/explorer/explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
const [dataSourceConnectionType, setDataSourceConnectionType] = useState<DatasourceType>(
'PROMETHEUS'
);
const dataSourceName = explorerSearchMeta?.datasources[0]?.label;
const dataSourceName = explorerSearchMeta?.datasources?.[0]?.label;
const renderTablesFlyout = getRenderLogExplorerTablesFlyout();
const renderCreateAccelerationFlyout = getRenderCreateAccelerationFlyout();
const isS3Connection = explorerSearchMeta.datasources?.[0]?.type === 's3glue';
Expand All @@ -227,7 +227,7 @@
return explorerSearchMeta.datasources?.[0]?.type
? dataSourcePluggables[explorerSearchMeta?.datasources[0]?.type]
: dataSourcePluggables.DEFAULT_INDEX_PATTERNS;
}, [explorerSearchMeta.datasources]);

Check warning on line 230 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useMemo has a missing dependency: 'dataSourcePluggables'. Either include it or remove the dependency array
const { ui } =
currentPluggable?.getComponentSetForVariation(
'languages',
Expand Down Expand Up @@ -266,14 +266,14 @@
tempQueryRef.current = tempQuery;

const updateDataSourceConnectionInfo = () => {
coreRefs.http!.get(`${DATACONNECTIONS_BASE}/${dataSourceName}`).then((data: any) => {

Check warning on line 269 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
setDataSourceConnectionType(data.connector);
});
};

useEffect(() => {
updateDataSourceConnectionInfo();
}, [dataSourceName]);

Check warning on line 276 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'updateDataSourceConnectionInfo'. Either include it or remove the dependency array

const findAutoInterval = (start: string = '', end: string = '') => {
const minInterval = findMinInterval(start, end);
Expand Down Expand Up @@ -305,7 +305,7 @@
queryToRun,
startTimeRange,
endTimeRange,
}: any = historyFromRedirection.location.state;

Check warning on line 308 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
batch(() => {
if (datasourceName && datasourceType) {
dispatch(
Expand Down Expand Up @@ -346,7 +346,7 @@
setEndTime(endTimeRange);
}
});
}, []);

Check warning on line 349 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has missing dependencies: 'dispatch', 'historyFromRedirection.location.state', 'setEndTime', 'setStartTime', and 'tabId'. Either include them or remove the dependency array. If 'setStartTime' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
const handleSetBrowserTabFocus = () => {
Expand All @@ -373,10 +373,10 @@
setRefresh({});
});
}
}, []);

Check warning on line 376 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'http'. Either include it or remove the dependency array

const getErrorHandler = (title: string) => {
return (error: any) => {

Check warning on line 379 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
if (coreRefs.summarizeEnabled) return;
const formattedError = formatError(error.name, error.message, error.body.message);
notifications.toasts.addError(formattedError, {
Expand Down Expand Up @@ -491,7 +491,7 @@
callbackInApp(() => prepareAvailability());
}
}
}, [appBasedRef.current]);

Check warning on line 494 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has missing dependencies: 'callback', 'callbackInApp', and 'prepareAvailability'. Either include them or remove the dependency array. Mutable values like 'appBasedRef.current' aren't valid dependencies because mutating them doesn't re-render the component

useEffect(() => {
if (
Expand All @@ -500,14 +500,14 @@
) {
setSelectedContentTab(TAB_CHART_ID);
}
}, []);

Check warning on line 503 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'routerContext'. Either include it or remove the dependency array

useEffect(() => {
if (savedObjectId && !isObjectIdUpdatedFromSave.current) {
updateTabData(savedObjectId);
isObjectIdUpdatedFromSave.current = false;
}
}, [savedObjectId]);

Check warning on line 510 in public/components/event_analytics/explorer/explorer.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'updateTabData'. Either include it or remove the dependency array

const handleTimePickerChange = async (timeRange: string[]) => {
if (appLogEvents) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const getValidFilterFields = (
page: 'dashboard' | 'traces' | 'services' | 'app',
attributesFilterFields: string[]
) => {
if (!attributesFilterFields) return [];
const fields = getFields(mode, page, attributesFilterFields);
if (page !== 'services') return [...fields, 'Latency percentile within trace group'];
return fields;
Expand Down
Loading