Skip to content
Merged
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
4 changes: 2 additions & 2 deletions app/client/src/AppErrorBoundry.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Component } from "react";
import styled from "styled-components";
import AppCrashImage from "assets/images/404-image.png";
import * as Sentry from "@sentry/react";
import log from "loglevel";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import { Button } from "@appsmith/ads";
import captureException from "instrumentation/sendFaroErrors";

const Wrapper = styled.div`
display: flex;
Expand Down Expand Up @@ -32,7 +32,7 @@ class AppErrorBoundary extends Component {

componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
log.error({ error, errorInfo });
Sentry.captureException(error);
captureException(error, { errorName: "AppErrorBoundary" });
AnalyticsUtil.logEvent("APP_CRASH", { error, errorInfo });
this.setState({
hasError: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Tag } from "@blueprintjs/core";
import styled from "styled-components";
import { UIComponentTypes } from "entities/Plugin";
import log from "loglevel";
import * as Sentry from "@sentry/react";
import captureException from "instrumentation/sendFaroErrors";
import type { FormEvalOutput } from "reducers/evaluationReducers/formEvaluationReducer";
import {
checkIfSectionCanRender,
Expand Down Expand Up @@ -103,7 +103,7 @@ const FormRender = (props: Props) => {
}
} catch (e) {
log.error(e);
Sentry.captureException(e);
captureException(e, { errorName: "FormRenderError" });

return (
<ErrorComponent
Expand Down
11 changes: 4 additions & 7 deletions app/client/src/actions/pageActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import type { APP_MODE } from "entities/App";
import type { CanvasWidgetsReduxState } from "ee/reducers/entityReducers/canvasWidgetsReducer";
import type { ENTITY_TYPE } from "ee/entities/AppsmithConsole/utils";
import type { Replayable } from "entities/Replay/ReplayEntity/ReplayEditor";
import * as Sentry from "@sentry/react";
import type { DSLWidget } from "../WidgetProvider/constants";
import type {
LayoutOnLoadActionErrors,
Expand All @@ -30,6 +29,7 @@ import { ReplayOperation } from "entities/Replay/ReplayEntity/ReplayOperations";
import type { PACKAGE_PULL_STATUS } from "ee/constants/ModuleConstants";
import type { ApiResponse } from "api/ApiResponses";
import type { EvaluationReduxAction } from "./EvaluationReduxActionTypes";
import captureException from "instrumentation/sendFaroErrors";

export interface FetchPageListPayload {
applicationId: string;
Expand Down Expand Up @@ -322,13 +322,10 @@ export interface UpdatePageActionPayload {
export const updatePageAction = (
payload: UpdatePageActionPayload,
): ReduxAction<UpdatePageActionPayload> => {
// Update page *needs* id to be there. We found certain scenarios
// where this was not happening and capturing the error to know gather
// more info: https://github.com/appsmithorg/appsmith/issues/16435
if (!payload.id) {
Sentry.captureException(
new Error("Attempting to update page without page id"),
);
captureException(new Error("Attempting to update page without page id"), {
errorName: "PageActions_UpdatePage",
});
}

return {
Expand Down
5 changes: 3 additions & 2 deletions app/client/src/api/helpers/validateJsonResponseMeta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Sentry from "@sentry/react";
import captureException from "instrumentation/sendFaroErrors";
import type { AxiosResponse } from "axios";
import { CONTENT_TYPE_HEADER_KEY } from "PluginActionEditor/constants/CommonApiConstants";

Expand All @@ -7,7 +7,8 @@ export const validateJsonResponseMeta = (response: AxiosResponse) => {
response.headers[CONTENT_TYPE_HEADER_KEY] === "application/json" &&
!response.data.responseMeta
) {
Sentry.captureException(new Error("Api responded without response meta"), {
captureException(new Error("Api responded without response meta"), {
errorName: "ValidateJsonResponseMeta",
contexts: { response: response.data },
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { AxiosError } from "axios";
import * as Sentry from "@sentry/react";
import type { ApiResponse } from "api/types";
import captureException from "instrumentation/sendFaroErrors";

export const handleMissingResponseMeta = async (
error: AxiosError<ApiResponse>,
) => {
if (error.response?.data && !error.response.data.responseMeta) {
Sentry.captureException(new Error("Api responded without response meta"), {
captureException(new Error("Api responded without response meta"), {
errorName: "MissingResponseMeta",
contexts: { response: { ...error.response.data } },
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
ERROR_CODES,
SERVER_ERROR_CODES,
} from "ee/constants/ApiConstants";
import * as Sentry from "@sentry/react";
import type { AxiosError } from "axios";
import type { ApiResponse } from "api/types";
import { is404orAuthPath } from "api/helpers";
import captureException from "instrumentation/sendFaroErrors";

export async function handleNotFoundError(error: AxiosError<ApiResponse>) {
if (is404orAuthPath()) return null;
Expand All @@ -20,7 +20,7 @@ export async function handleNotFoundError(error: AxiosError<ApiResponse>) {
(SERVER_ERROR_CODES.RESOURCE_NOT_FOUND.includes(errorData.error?.code) ||
SERVER_ERROR_CODES.UNABLE_TO_FIND_PAGE.includes(errorData?.error?.code))
) {
Sentry.captureException(error);
captureException(error, { errorName: "NotFoundError" });

return Promise.reject({
...error,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import store from "store";
import type { AxiosError } from "axios";
import * as Sentry from "@sentry/react";
import { is404orAuthPath } from "api/helpers";
import { logoutUser } from "actions/userActions";
import { AUTH_LOGIN_URL } from "constants/routes";
import { API_STATUS_CODES, ERROR_CODES } from "ee/constants/ApiConstants";
import captureException from "instrumentation/sendFaroErrors";

export const handleUnauthorizedError = async (error: AxiosError) => {
if (is404orAuthPath()) return null;
Expand All @@ -20,7 +20,7 @@ export const handleUnauthorizedError = async (error: AxiosError) => {
}),
);

Sentry.captureException(error);
captureException(error, { errorName: "UnauthorizedError" });

return Promise.reject({
...error,
Expand Down
6 changes: 4 additions & 2 deletions app/client/src/ce/sagas/PageSagas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ import { clearEvalCache } from "../../sagas/EvaluationsSaga";
import { getQueryParams } from "utils/URLUtils";
import log from "loglevel";
import { migrateIncorrectDynamicBindingPathLists } from "utils/migrations/IncorrectDynamicBindingPathLists";
import * as Sentry from "@sentry/react";
import { ERROR_CODES } from "ee/constants/ApiConstants";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import DEFAULT_TEMPLATE from "templates/default";
Expand Down Expand Up @@ -152,6 +151,7 @@ import {
selectCombinedPreviewMode,
selectGitApplicationCurrentBranch,
} from "selectors/gitModSelectors";
import captureException from "instrumentation/sendFaroErrors";

export const checkIfMigrationIsNeeded = (
fetchPageResponse?: FetchPageResponse,
Expand Down Expand Up @@ -570,7 +570,9 @@ export function* savePageSaga(action: ReduxAction<{ isRetry?: boolean }>) {
const { message } = incorrectBindingError;

if (isRetry) {
Sentry.captureException(new Error("Failed to correct binding paths"));
captureException(new Error("Failed to correct binding paths"), {
errorName: "PageSagas_BindingPathCorrection",
});
yield put({
type: ReduxActionErrorTypes.FAILED_CORRECTING_BINDING_PATHS,
payload: {
Expand Down
6 changes: 3 additions & 3 deletions app/client/src/ce/utils/AnalyticsUtil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SegmentSingleton from "utils/Analytics/segment";
import MixpanelSingleton, {
type SessionRecordingConfig,
} from "utils/Analytics/mixpanel";
import SentryUtil from "utils/Analytics/sentry";
import FaroUtil from "utils/Analytics/sentry";
import SmartlookUtil from "utils/Analytics/smartlook";
import TrackedUser from "ee/utils/Analytics/trackedUser";

Expand All @@ -31,7 +31,7 @@ async function initialize(
user: User,
sessionRecordingConfig: SessionRecordingConfig,
) {
SentryUtil.init();
// SentryUtil.init();
await SmartlookUtil.init();

segmentAnalytics = SegmentSingleton.getInstance();
Expand Down Expand Up @@ -94,7 +94,7 @@ async function identifyUser(userData: User, sendAdditionalData?: boolean) {
await segmentAnalytics.identify(trackedUser.userId, userProperties);
}

SentryUtil.identifyUser(trackedUser.userId, userData);
FaroUtil.identifyUser(trackedUser.userId, userData);

if (trackedUser.email) {
SmartlookUtil.identify(trackedUser.userId, trackedUser.email);
Expand Down
3 changes: 1 addition & 2 deletions app/client/src/components/SentryRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from "@sentry/react";
import { Route } from "react-router";

export const SentryRoute = Sentry.withSentryRouting(Route);
export const SentryRoute = Route;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Classes, Collapse } from "@blueprintjs/core";
import { UNDEFINED_VALIDATION } from "utils/validation/common";
import copy from "copy-to-clipboard";

import * as Sentry from "@sentry/react";
import type { CodeEditorExpected } from "components/editorComponents/CodeEditor/index";
import type { Indices } from "constants/Layers";
import { Layers } from "constants/Layers";
Expand All @@ -29,6 +28,7 @@ import { getPathNavigationUrl } from "selectors/navigationSelectors";
import { Button, Icon, Link, toast, Tooltip } from "@appsmith/ads";
import type { EvaluationError } from "utils/DynamicBindingUtils";
import { DEBUGGER_TAB_KEYS } from "../Debugger/constants";
import captureException from "instrumentation/sendFaroErrors";

const modifiers: IPopoverSharedProps["modifiers"] = {
offset: {
Expand Down Expand Up @@ -290,8 +290,8 @@ export function PreparedStatementViewer(props: {
const { parameters, value } = props.evaluatedValue;

if (!value) {
Sentry.captureException("Prepared statement got no value", {
level: "debug",
captureException(new Error("Prepared statement got no value"), {
errorName: "PreparedStatementError",
extra: { props },
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ import { Button } from "@appsmith/ads";
import "codemirror/addon/fold/brace-fold";
import "codemirror/addon/fold/foldgutter";
import "codemirror/addon/fold/foldgutter.css";
import * as Sentry from "@sentry/react";
import type { EvaluationError, LintError } from "utils/DynamicBindingUtils";
import { getEvalErrorPath, isDynamicValue } from "utils/DynamicBindingUtils";
import {
Expand Down Expand Up @@ -1919,6 +1918,4 @@ const mapDispatchToProps = (dispatch: any) => ({
resetActiveField: () => dispatch(resetActiveEditorField()),
});

export default Sentry.withProfiler(
connect(mapStateToProps, mapDispatchToProps)(CodeEditor),
);
export default connect(mapStateToProps, mapDispatchToProps)(CodeEditor);
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as Sentry from "@sentry/react";
import classNames from "classnames";
import React, {
memo,
Expand Down Expand Up @@ -173,4 +172,4 @@ export const EntityExplorerSidebar = memo(({ children }: Props) => {

EntityExplorerSidebar.displayName = "EntityExplorerSidebar";

export default Sentry.withProfiler(EntityExplorerSidebar);
export default EntityExplorerSidebar;
4 changes: 2 additions & 2 deletions app/client/src/components/editorComponents/ErrorBoundry.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import styled from "styled-components";
import * as Sentry from "@sentry/react";
import * as log from "loglevel";
import captureException from "instrumentation/sendFaroErrors";

import type { ReactNode, CSSProperties } from "react";

Expand Down Expand Up @@ -39,7 +39,7 @@ class ErrorBoundary extends React.Component<Props, State> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
componentDidCatch(error: any, errorInfo: any) {
log.error({ error, errorInfo });
Sentry.captureException(error);
captureException(error, { errorName: "ErrorBoundary" });
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import React, {
useMemo,
useRef,
} from "react";
import * as Sentry from "@sentry/react";
import { useSelector } from "react-redux";
import { getSelectedWidgets } from "selectors/ui";
import WidgetPropertyPane from "pages/Editor/PropertyPane";
Expand Down Expand Up @@ -104,4 +103,4 @@ export const PropertyPaneSidebar = memo(() => {

PropertyPaneSidebar.displayName = "PropertyPaneSidebar";

export default Sentry.withProfiler(PropertyPaneSidebar);
export default PropertyPaneSidebar;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { Component } from "react";
import type { AppState } from "ee/reducers";
import { connect } from "react-redux";
import type { Placement } from "popper.js";
import * as Sentry from "@sentry/react";
import _ from "lodash";
import type { ControlProps } from "./BaseControl";
import BaseControl from "./BaseControl";
Expand Down Expand Up @@ -407,6 +406,6 @@ const mapStateToProps = (state: AppState): ReduxStateProps => ({
datasources: state.entities.datasources,
});

const EvaluatedValuePopupWrapper = Sentry.withProfiler(
connect(mapStateToProps)(EvaluatedValuePopupWrapperClass),
const EvaluatedValuePopupWrapper = connect(mapStateToProps)(
EvaluatedValuePopupWrapperClass,
);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AppState } from "ee/reducers";
import * as Sentry from "@sentry/react";

import type { CodeEditorExpected } from "components/editorComponents/CodeEditor";
import { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig";
import EvaluatedValuePopup from "components/editorComponents/CodeEditor/EvaluatedValuePopup";
Expand Down Expand Up @@ -548,6 +548,6 @@ const mapStateToProps = (
};
};

const EvaluatedValuePopupWrapper = Sentry.withProfiler(
connect(mapStateToProps)(EvaluatedValuePopupWrapperClass),
const EvaluatedValuePopupWrapper = connect(mapStateToProps)(
EvaluatedValuePopupWrapperClass,
);
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { Component } from "react";
import type { AppState } from "ee/reducers";
import { connect } from "react-redux";
import type { Placement } from "popper.js";
import * as Sentry from "@sentry/react";
import _, { toString } from "lodash";
import type { ControlProps } from "./BaseControl";
import BaseControl from "./BaseControl";
Expand Down Expand Up @@ -497,6 +496,6 @@ const mapStateToProps = (
};
};

const EvaluatedValuePopupWrapper = Sentry.withProfiler(
connect(mapStateToProps)(EvaluatedValuePopupWrapperClass),
const EvaluatedValuePopupWrapper = connect(mapStateToProps)(
EvaluatedValuePopupWrapperClass,
);
13 changes: 8 additions & 5 deletions app/client/src/components/propertyControls/TabControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import isString from "lodash/isString";
import isUndefined from "lodash/isUndefined";
import includes from "lodash/includes";
import map from "lodash/map";
import * as Sentry from "@sentry/react";
import captureException from "instrumentation/sendFaroErrors";
import { useDispatch } from "react-redux";
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import { DraggableListControl } from "pages/Editor/PropertyPane/DraggableListControl";
Expand Down Expand Up @@ -131,10 +131,13 @@ class TabControl extends BaseControl<ControlProps, State> {

return parsedData;
} catch (error) {
Sentry.captureException({
message: "Tab Migration Failed",
oldData: this.props.propertyValue,
});
captureException(
{
message: "Tab Migration Failed",
oldData: this.props.propertyValue,
},
{ errorName: "TabMigrationError" },
);
}
} else {
return this.props.propertyValue;
Expand Down
4 changes: 2 additions & 2 deletions app/client/src/ee/sagas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { sagas as CE_Sagas } from "ce/sagas";
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import { call, all, spawn, race, take } from "redux-saga/effects";
import log from "loglevel";
import * as sentry from "@sentry/react";
import captureException from "instrumentation/sendFaroErrors";

const sagasArr = [...CE_Sagas];

Expand All @@ -22,7 +22,7 @@ export function* rootSaga(sagasToRun = sagasArr): any {
break;
} catch (e) {
log.error(e);
sentry.captureException(e);
captureException(e, { errorName: "RootSagaError" });
}
}
}),
Expand Down
Loading
Loading