Skip to content

[Detail Bug] Tasks: Approving per-chart description updates on Dashboards reports success but does not change Chart descriptions #35095

Closed

Description

@detail-app

Detail Bug Report

https://app.detail.dev/org_3377c26d-da48-4ccd-b83a-22c542f4fe83/bugs/bug_1dd67345-94d8-4415-8334-25fee1df7f6c

Introduced in #25894 by @harshach on Apr 23, 2026

Summary

  • Context: FieldPathUtils.updateFieldDescription resolves a child container named in a task's fieldPath (e.g. charts::<chartName>::description), mutates the matching child POJO's description in memory, diffs the parent entity, and patches it; it returns true unconditionally after forwarding a non-empty JSON patch to repository.patch(...).
  • Bug: For Dashboard, resolveContainerList resolves charts to dashboard.getCharts() — a List<EntityReference> — via the reflective fallback. The reflected setter writes onto a transient EntityReference that DashboardRepository.prepare rebuilds from the actual Chart entity during prepareInternal, so the only meaningful change in the patch (the chart's description) is silently reverted. The real Chart entity is never patched. updateFieldDescription still returns true.
  • Actual vs. expected: An approved DescriptionUpdate task on a Dashboard chart (UI field path charts::<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 persisted

Explanation

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions