ARBS-23 opened a new issue, #44305:
URL: https://github.com/apache/superset/issues/44305

   ### Bug description
   
   Saving a **new chart** from Explore and adding it to an existing dashboard 
does **not** update that dashboard's **Last modified** value in the Dashboards 
list.
   
   The chart is linked correctly (it appears on the dashboard), but the 
dashboard row's `changed_on` stays unchanged. Users looking at the list cannot 
tell the dashboard was just modified.
   
   This happens because Explore save (`CreateChartCommand` / `POST 
/api/v1/chart/` with `dashboards: [id]`) only inserts the `dashboard_slices` 
M2M row. It does not touch `dashboards.changed_on` or `changed_by`. The 
Dashboards list column is sourced from the dashboard row (`changed_on` / 
`changed_on_delta_humanized`), not from 
`DashboardDAO.get_dashboard_and_slices_changed_on()`.
   
   ### How to reproduce the bug
   
   1. Log in as a user who can create charts and edit dashboards.
   2. Open **Dashboards** and note **Last modified** for an existing dashboard.
   3. Go to **Charts** → **+ Chart**.
   4. Configure a chart (any viz type / dataset).
   5. Click **Save**.
   6. In the save modal, choose **Add to dashboard** and select that existing 
dashboard.
   7. Click **Save**.
   8. Open **Dashboards** again and check **Last modified** for that dashboard.
   
   ### Screenshots/recordings
   
   
https://github.com/user-attachments/assets/9ff9d7b3-aa81-4bde-8132-92443122ae81
   
   ### Expected behavior
   
   Adding a chart to a dashboard should update that dashboard's **Last 
modified** (and `changed_by`) to the save time, the same as editing the 
dashboard layout or properties.
   
   ### Actual behavior
   
   The chart is created and attached to the dashboard, but **Last modified** on 
the Dashboards list does not change.
   
   ### Superset version
   
   6.1.0 (also observed on a deployment based on `apache/superset:6.1.0-py311`)
   
   ### Python version
   
   3.11
   
   ### Node version
   
   18 or greater
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   - OS: Windows 11
   - Role: user with chart/dashboard **Edit** permission
   - Reproduced via Explore **Save** → add to an existing dashboard (new chart, 
not overwrite)
   - Root cause in 6.1.0: 
[`CreateChartCommand`](https://github.com/apache/superset/blob/6.1.0/superset/commands/chart/create.py)
 populates `self._properties["dashboards"]` from `DashboardDAO.find_by_ids()` 
and `ChartDAO.create()` writes the `dashboard_slices` association. 
`dashboards.changed_on` is never updated. The same gap likely exists on chart 
update (`PUT /api/v1/chart/{id}` with an added dashboard id).
   - `DashboardDAO.get_dashboard_and_slices_changed_on()` already computes 
max(dashboard.changed_on, slices.changed_on) for other freshness paths, but the 
list view does not use that helper.
   - Internal tracker (optional): gigaphoton/fabscape-superset#148
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to