Repository navigation
[Bug] Exporting a Skill while autosave is pending downloads stale file content #44599
Description
Self Checks
- I have read the Contributing Guide and Language Policy.
- This is only for bug report, if you would like to ask a question, please head to Discussions.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report, otherwise it will be closed.
- 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- Please do not modify this template :) and fill in all the required fields.
Dify version
1.18.0 release candidate, commit 720d8489453cea51c26382e43f4b8ba7024a6dca, tested during #44546 release verification on 2026-10-23.
Cloud or Self Hosted
Self Hosted (Source). Production web build on macOS with Chromium; isolated local API/worker and Docker infrastructure.
Steps to reproduce
- Import or create a Skill containing
SKILL.md, publish it, and open its detail editor. - Open Source editor and edit a unique marker in
SKILL.md. In this reproduction, changeQA118_REBASE_FINALtoQA118_MAIN_FINAL. - Immediately open the Skill's More actions → Export menu while autosave is pending.
- Extract
SKILL.mdfrom the downloaded ZIP and compare its marker with the visible editor. - Wait until autosave completes, export again, and compare the second ZIP.
Recording condition: the video delays the real PATCH /skills/{id}/files request by five seconds to make the pending-save window reproducible. It does not mock the server response. The first export completes before the PATCH starts; the normal editor also debounces saves by one second.
Reproduction video — 8.68 seconds
bug-02-skill-export.mp4
The video shows the edit and export actions. The extracted ZIP contents and request timing below establish the stale result.
✔️ Expected Behavior
Export from the editor should include the latest edited file content. It should flush and await pending saves before generating the archive, or make export unavailable while those changes are unsaved.
❌ Actual Behavior
Export remains available and downloads the previously saved version, despite the newer content displayed in Source editor.
Verified extracted SKILL.md content:
Visible editor after edit:
Original draft marker: QA118_MAIN_FINAL.
First ZIP, exported while autosave was pending:
Original draft marker: QA118_REBASE_FINAL.
Second ZIP, exported after autosave completed:
Original draft marker: QA118_MAIN_FINAL.
Recorded ordering relative to the edit:
| Event | Elapsed time |
|---|---|
| Edit completed | 0 ms |
| First ZIP downloaded | 348 ms |
| PATCH save request began | 1,004 ms |
| PATCH completed with HTTP 200 | 6,047 ms |
| Second ZIP downloaded | 6,402 ms |
Code path
The file editor schedules draft saving after 1,000 ms. The sidebar export action fetches the archive independently; its menu action checks the export mutation rather than awaiting the editor's save.
Temporary workaround: wait for autosave completion before exporting. This is a pending-save race; exporting the latest fully saved draft passed the control check.
Activity