Repository navigation
Description
Detail Bug Report
Introduced in #25894 by @harshach on Apr 23, 2026
Summary
- Context:
FieldPathUtils.updateFieldDescriptionresolves a child container named in a task'sfieldPath(e.g.charts::<chartName>::description), mutates the matching child POJO's description in memory, diffs the parent entity, and patches it; it returnstrueunconditionally after forwarding a non-empty JSON patch torepository.patch(...). - Bug: For Dashboard,
resolveContainerListresolveschartstodashboard.getCharts()— aList<EntityReference>— via the reflective fallback. The reflected setter writes onto a transientEntityReferencethatDashboardRepository.preparerebuilds from the actualChartentity duringprepareInternal, so the only meaningful change in the patch (the chart'sdescription) is silently reverted. The realChartentity is never patched.updateFieldDescriptionstill returnstrue. - Actual vs. expected: An approved
DescriptionUpdatetask on a Dashboard chart (UI field pathcharts::<chartName>::description,about= Dashboard entity link) is marked resolved and logged as "Successfully applied description update", but the Chart's stored description is unchanged — the change is lost. - Impact: A user accepts a suggestion/task to update a Dashboard chart's description; the task silently does nothing while the resolver UI lists it as "Approved". The chart description shown in the UI and API remains the pre-task value, and the chart's search document is never reindexed. The change is lost with no signal to the user or any downstream system.
Code with Bug
openmetadata-service/src/main/java/org/openmetadata/service/util/FieldPathUtils.java:
private static List<?> resolveContainerList(EntityInterface<?> entity, String container) {
List<?> fromRegistry = ChildFieldResolver.containerListFor(entity, container);
return fromRegistry != null ? fromRegistry : getFieldList(entity, container);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^
// <-- BUG 🔴 For Dashboard, reflective fallback returns List<EntityReference> for "charts";
// mutating EntityReference.description is not persisted and is later rebuilt/reverted.
}
private static boolean setDescription(Object field, String description) {
try {
Method setter = field.getClass().getMethod("setDescription", String.class);
setter.invoke(field, description); // <-- BUG 🔴 writes onto transient EntityReference
return true;
} catch (Exception e) { ... return false; }
}
repository.patch(null, entity.getId(), user, patch, changeSource, null);
LOG.info("[FieldPathUtils] Updated description at '{}' in entity '{}'", fieldPath, entity.getName());
return true; // <-- BUG 🔴 reports success without verifying the change actually persistedExplanation
Dashboard chart “description update” tasks are created with about = Dashboard and fieldPath = charts::<chartName>::description, so the backend loads a Dashboard and calls FieldPathUtils.updateFieldDescription(entity=Dashboard, repository=DashboardRepository, ...).
FieldPathUtils treats the charts container as a list of editable child objects and uses reflection to call setDescription on the matching list element. On Dashboards, charts is List<EntityReference> (a projection of separate Chart entities), so the mutation only affects an in-memory reference.
When DashboardRepository.patch(...) runs, prepareInternal calls DashboardRepository.prepare, which rebuilds dashboard.charts from the persisted Chart entities (via EntityUtil.getEntityReferences(...)). Since the Chart entity itself was never patched, the rebuilt EntityReference description comes from the old stored Chart.description, effectively undoing the patch.
Despite this being a no-op from the user’s perspective, updateFieldDescription returns true, so the task workflow logs success and the task is marked resolved.
Codebase Inconsistency
openmetadata-service/src/main/java/org/openmetadata/service/util/ChildFieldResolver.java explicitly excludes Dashboard charts from its registry (“Charts are deliberately absent: a chart is a separate entity with its own RBAC and is patched directly.”), but FieldPathUtils.resolveContainerList still reflectively resolves dashboard.getCharts() and treats it as patchable child state.
Recommended Fix
Make the silent no-op visible by rejecting reflective containers that resolve to List<EntityReference> (so setFieldDescription fails and the task is not incorrectly marked successful). Example:
private static List<?> resolveContainerList(EntityInterface<?> entity, String container) {
List<?> fromRegistry = ChildFieldResolver.containerListFor(entity, container);
if (fromRegistry != null) {
return fromRegistry;
}
List<?> reflective = getFieldList(entity, container);
if (reflective != null && !reflective.isEmpty() && reflective.get(0) instanceof EntityReference) {
LOG.warn("[FieldPathUtils] '{}' resolves to EntityReference list on {}; child must be patched directly, not through the parent",
container, entity.getClass().getSimpleName());
return null;
}
return reflective;
}History
This bug was introduced in commit 51ecf45. The "Task redesign" PR (#25894) introduced FieldPathUtils.updateFieldDescription and TaskWorkflowHandler.applyDescriptionAction as a single change: the reflective getFieldList(entity, container) fallback (with the comment "Try direct field lists first (columns, fields, schemaFields, tasks, charts)") resolves charts on a Dashboard to List<EntityReference>, mutates the transient EntityReference's description, generates a JSON patch against the Dashboard, and forwards it to DashboardRepository.patch — which was already reverting chart descriptions via prepare() since bea38d7200 (PR #10636, 2023-03-28). The bug was present from day one of this code path: the Task redesign wired a description-update workflow through a reflective resolver that treats EntityReference as an editable child POJO, while DashboardRepository.prepare() had been rebuilding charts from the persisted (unmodified) Chart entities for three years prior. The silent return true after repository.patch(...) meant the no-op was never surfaced.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone ✅
Activity