ARBS-23 opened a new issue, #44306:
URL: https://github.com/apache/superset/issues/44306
### Bug description
After renaming a chart from the Charts list **Properties** modal, exporting
that chart **without refreshing the page** produces a ZIP whose inner YAML
still uses the **old** chart name:
`charts/{old_chart_name}_{chart_id}.yaml`
A full page refresh, then export again, yields the updated filename.
Export only sends chart IDs (`GET /api/v1/chart/export/?q=!(<id>)`). The ZIP
entry name is built server-side from `Slice.slice_name` via
`ExportChartsCommand._file_name()` → `get_filename(model.slice_name,
model.id)`. So a fresh export after a successful rename should already include
the new name.
On **6.1.0**, chart/dashboard/dataset export responses inherit Flask's
`SEND_FILE_MAX_AGE_DEFAULT` (1 year). Re-exporting the same chart IDs therefore
hits the same URL and can be served from browser cache — including an archive
built **before** the rename. That matches this symptom and the broader report
in https://github.com/apache/superset/issues/41687 (fixed on `master` by
https://github.com/apache/superset/pull/43185).
### How to reproduce the bug
1. Log in as a user who can edit and export charts.
2. Open **Charts**.
3. Export a chart once (optional but makes the cache hit clearer): note the
YAML name inside the ZIP, e.g. `charts/Old_Name_123.yaml`.
4. Open that chart's **Properties**, change **Name** to a new value, and
save.
5. **Without refreshing the page**, export the same chart again.
6. Unzip and inspect `charts/*.yaml`.
### Screenshots/recordings
https://github.com/user-attachments/assets/6d15f675-c032-4571-8f77-a32e565e6969
### Expected behavior
The exported ZIP should use the **current** chart name in the YAML path (and
in `slice_name` inside the YAML) immediately after rename/save, with no page
refresh required.
### Actual behavior
The YAML filename (and contents) still reflect the name from before the
rename until the page is refreshed and the chart is exported again.
### 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 edit/export permission
- Reproduced via Charts list → Properties → rename → Export (ZIP / YAML
export, not CSV)
- Likely root cause on 6.1.0: export `send_file` inherits `Cache-Control:
public, max-age=31536000` so identical `?q=` export URLs return a stale ZIP
after metadata changes (rename). See
https://github.com/apache/superset/issues/41687 and fix
https://github.com/apache/superset/pull/43185 (`send_export_zip` with
`max_age=0` / `no-store`).
- Please confirm whether this rename→export case is fully covered by #43185
on `master`, and whether a 6.1.x backport is planned. This issue is the
concrete user-facing rename reproduction.
- Filename construction:
[`ExportChartsCommand._file_name`](https://github.com/apache/superset/blob/6.1.0/superset/commands/chart/export.py)
- Client export URL (IDs only, no name):
[`handleResourceExport`](https://github.com/apache/superset/blob/6.1.0/superset-frontend/src/utils/export.ts)
- Internal tracker (optional): gigaphoton/fabscape-superset#153
### 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]