diff --git a/app/client/src/sagas/PostEvaluationSagas.ts b/app/client/src/sagas/PostEvaluationSagas.ts index 8704e02131..fac3ab7b3f 100644 --- a/app/client/src/sagas/PostEvaluationSagas.ts +++ b/app/client/src/sagas/PostEvaluationSagas.ts @@ -177,7 +177,7 @@ export function* evalErrorHandler( case EvalErrorTypes.CYCLICAL_DEPENDENCY_ERROR: { if (error.context) { // Add more info about node for the toast - const { entityType, node } = error.context; + const { dependencyMap, diffs, entityType, node } = error.context; Toaster.show({ text: `${error.message} Node was: ${node}`, variant: Variant.danger, @@ -191,6 +191,10 @@ export function* evalErrorHandler( node, entityType, }, + extra: { + dependencyMap, + diffs, + }, // Level is warning because it could be a user error level: Sentry.Severity.Warning, }); diff --git a/app/client/src/workers/DataTreeEvaluator.ts b/app/client/src/workers/DataTreeEvaluator.ts index b28f30e193..3b041f79a0 100644 --- a/app/client/src/workers/DataTreeEvaluator.ts +++ b/app/client/src/workers/DataTreeEvaluator.ts @@ -26,6 +26,7 @@ import { addErrorToEntityProperty, convertPathToString, CrashingError, + DataTreeDiff, DataTreeDiffEvent, getAllPaths, getEntityNameAndPropertyPath, @@ -483,7 +484,10 @@ export default class DataTreeEvaluator { } } - sortDependencies(dependencyMap: DependencyMap): Array { + sortDependencies( + dependencyMap: DependencyMap, + diffs?: (DataTreeDiff | DataTreeDiff[])[], + ): Array { const dependencyTree: Array<[string, string]> = []; Object.keys(dependencyMap).forEach((key: string) => { if (dependencyMap[key].length) { @@ -519,6 +523,8 @@ export default class DataTreeEvaluator { context: { node, entityType, + dependencyMap, + diffs, }, }); console.error("CYCLICAL DEPENDENCY MAP", dependencyMap); @@ -949,7 +955,10 @@ export default class DataTreeEvaluator { // global inverse dependency map if (didUpdateDependencyMap) { // This is being called purely to test for new circular dependencies that might have been added - this.sortedDependencies = this.sortDependencies(this.dependencyMap); + this.sortedDependencies = this.sortDependencies( + this.dependencyMap, + translatedDiffs, + ); this.inverseDependencyMap = this.getInverseDependencyTree(); } diff --git a/app/client/src/workers/evaluationUtils.ts b/app/client/src/workers/evaluationUtils.ts index 2efb3cc933..92bbbb2074 100644 --- a/app/client/src/workers/evaluationUtils.ts +++ b/app/client/src/workers/evaluationUtils.ts @@ -36,7 +36,7 @@ export enum DataTreeDiffEvent { NOOP = "NOOP", } -type DataTreeDiff = { +export type DataTreeDiff = { payload: { propertyPath: string; value?: string;