diff --git a/app/client/src/sagas/PostEvaluationSagas.ts b/app/client/src/sagas/PostEvaluationSagas.ts index ea4256aef1..afd8716cb3 100644 --- a/app/client/src/sagas/PostEvaluationSagas.ts +++ b/app/client/src/sagas/PostEvaluationSagas.ts @@ -252,19 +252,22 @@ export function* evalErrorHandler( AppsmithConsole.error({ text: `${error.message} Node was: ${node}`, }); - // Send the generic error message to sentry for better grouping - Sentry.captureException(new Error(error.message), { - tags: { - node, - entityType, - }, - extra: { - dependencyMap, - diffs, - }, - // Level is warning because it could be a user error - level: Sentry.Severity.Warning, - }); + if (error.context.logToSentry) { + // Send the generic error message to sentry for better grouping + Sentry.captureException(new Error(error.message), { + tags: { + node, + entityType, + }, + extra: { + dependencyMap, + diffs, + }, + // Level is warning because it could be a user error + level: Sentry.Severity.Warning, + }); + } + // Log an analytics event for cyclical dep errors AnalyticsUtil.logEvent("CYCLICAL_DEPENDENCY_ERROR", { node, diff --git a/app/client/src/workers/common/DataTreeEvaluator/index.ts b/app/client/src/workers/common/DataTreeEvaluator/index.ts index 9b995cd64b..b9c3b15b8c 100644 --- a/app/client/src/workers/common/DataTreeEvaluator/index.ts +++ b/app/client/src/workers/common/DataTreeEvaluator/index.ts @@ -1207,7 +1207,7 @@ export default class DataTreeEvaluator { sortDependencies( dependencyMap: DependencyMap, - diffs?: (DataTreeDiff | DataTreeDiff[])[], + diffs?: DataTreeDiff[], ): Array { const result = DependencyMapUtils.sortDependencies(dependencyMap); if (result.success) { @@ -1226,6 +1226,13 @@ export default class DataTreeEvaluator { entityType = entity.ENTITY_TYPE; } const dependencies = dependencyMap.dependencies; + + // We are only interested in logging potential system-generated cyclic dependency errors to Sentry + // If a cyclic dependency error occurs without a user editing a dynamic field, that is a potential system-generated cyclic dependency error + + const logToSentry = !diffs + ? false + : !diffs.some((val) => val.event === DataTreeDiffEvent.EDIT); this.errors.push({ type: EvalErrorTypes.CYCLICAL_DEPENDENCY_ERROR, message: "Cyclic dependency found while evaluating.", @@ -1234,6 +1241,7 @@ export default class DataTreeEvaluator { entityType, dependencyMap: dependencies, diffs, + logToSentry, }, }); logError("CYCLICAL DEPENDENCY MAP", dependencies); diff --git a/app/client/src/workers/common/DependencyMap/index.ts b/app/client/src/workers/common/DependencyMap/index.ts index 924d26d60e..4ea60b8914 100644 --- a/app/client/src/workers/common/DependencyMap/index.ts +++ b/app/client/src/workers/common/DependencyMap/index.ts @@ -309,8 +309,10 @@ export const updateDependencyMap = ({ if (didUpdateDependencyMap) { DependencyMapUtils.makeParentsDependOnChildren(dependencyMap); - dataTreeEvalRef.sortedDependencies = - dataTreeEvalRef.sortDependencies(dependencyMap); + dataTreeEvalRef.sortedDependencies = dataTreeEvalRef.sortDependencies( + dependencyMap, + translatedDiffs, + ); } if (didUpdateValidationDependencyMap) { dataTreeEvalRef.sortedValidationDependencies =