dify - ✅(Solved) Fix Workflow restore from top-right restore button clears draft when collaboration mode is disabled(1.14.0) [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#35790Fetched 2026-05-06 06:36:29
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
1
Author
Participants
Timeline (top)
cross-referenced ×2closed ×1commented ×1labeled ×1

Root Cause

The version item menu restore action works correctly because it calls: POST /console/api/apps/{app_id}/workflows/{workflow_id}/restore

Fix Action

Fixed

PR fix notes

PR #35795: fix(web): restore button clears draft when collaboration mode is disable

Description (problem / solution / changelog)

When ENABLE_COLLABORATION_MODE=false the CRDT layer is never initialised, so collaborationManager.setNodes/setEdges are silent no-ops and refreshGraphSynchronously emits graphImport with empty nodes/edges, wiping the canvas and saving an empty draft to the backend.

The top-right Restore button in the version-history panel now takes the same REST API path as the context-menu Restore when collaboration is disabled: POST /apps/{id}/workflows/{versionId}/restore followed by handleRefreshWorkflowDraft(). The CRDT path is preserved unchanged for when collaboration is enabled.

  • Add restoreVersionUrl prop to HeaderInRestoringProps
  • Pass restoreVersionUrl from WorkflowHeader
  • Split handleRestore into non-collab (REST) and collab (CRDT) branches
  • Add tests covering both branches and error/fallback cases

Fixes #35790

[!IMPORTANT]

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> <!-- If this PR was created by an automated agent, add `From <Tool Name>` as the final line of the description. Example: `From Codex`. -->

Screenshots

BeforeAfter
......

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Changed files

  • web/app/components/workflow-app/components/workflow-header/index.tsx (modified, +2/-1)
  • web/app/components/workflow/header/__tests__/header-in-restoring.spec.tsx (modified, +152/-11)
  • web/app/components/workflow/header/__tests__/header-layouts.spec.tsx (modified, +3/-0)
  • web/app/components/workflow/header/header-in-restoring.tsx (modified, +37/-3)

PR #35817: fix: restore workflow versions via backend API

Description (problem / solution / changelog)

[!IMPORTANT]

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> <!-- If this PR was created by an automated agent, add `From <Tool Name>` as the final line of the description. Example: `From Codex`. -->

fix https://github.com/langgenius/dify/issues/35790

Screenshots

BeforeAfter
......

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

Changed files

  • eslint-suppressions.json (modified, +1/-1)
  • web/app/components/workflow/__tests__/workflow-edge-events.spec.tsx (modified, +31/-1)
  • web/app/components/workflow/collaboration/core/__tests__/collaboration-manager.logs-and-events.spec.ts (modified, +1/-17)
  • web/app/components/workflow/collaboration/core/__tests__/collaboration-manager.socket-and-subscriptions.spec.ts (modified, +0/-8)
  • web/app/components/workflow/collaboration/core/collaboration-manager.ts (modified, +0/-20)
  • web/app/components/workflow/collaboration/types/collaboration.ts (modified, +0/-20)
  • web/app/components/workflow/header/__tests__/header-in-restoring.spec.tsx (modified, +4/-6)
  • web/app/components/workflow/header/__tests__/header-layouts.spec.tsx (modified, +64/-12)
  • web/app/components/workflow/header/header-in-restoring.tsx (modified, +80/-41)
  • web/app/components/workflow/hooks/__tests__/use-leader-restore.spec.ts (removed, +0/-262)
  • web/app/components/workflow/hooks/index.ts (modified, +0/-1)
  • web/app/components/workflow/hooks/use-leader-restore.ts (removed, +0/-164)
  • web/app/components/workflow/index.tsx (modified, +11/-3)
RAW_BUFFERClick to expand / collapse

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.14.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Deploy Dify 1.14.0 with Docker Compose.
  2. Keep collaboration mode disabled: ENABLE_COLLABORATION_MODE=false
  3. Open a workflow.
  4. Open the version history panel.
  5. Click a previous published workflow version. The canvas correctly previews that version.
  6. Click the top-right "Restore" button.
  7. The UI shows restore success, but the workflow draft canvas becomes empty.
  8. Restore again using the version item's context menu: "..." -> "Restore".
  9. This path calls: POST /console/api/apps/{app_id}/workflows/{workflow_id}/restore and works correctly.

✔️ Expected Behavior

Both restore entry points should restore the selected published workflow version into the draft workflow.

The top-right Restore button should either call the same backend restore endpoint as the version item menu restore action, or safely handle non-collaboration mode without clearing the graph.

❌ Actual Behavior

The top-right Restore button shows success, but the draft workflow graph becomes empty.

The version item menu restore action works correctly because it calls: POST /console/api/apps/{app_id}/workflows/{workflow_id}/restore

extent analysis

TL;DR

The top-right Restore button should be modified to call the same backend restore endpoint as the version item menu restore action to fix the issue.

Guidance

  • Investigate the code behind the top-right Restore button to determine why it's not calling the correct endpoint (POST /console/api/apps/{app_id}/workflows/{workflow_id}/restore) when collaboration mode is disabled.
  • Compare the implementation of the top-right Restore button with the version item menu restore action to identify the difference in behavior.
  • Verify that the top-right Restore button is correctly handling the response from the backend when collaboration mode is disabled.
  • Consider adding logging or debugging statements to the top-right Restore button code to understand why the draft workflow graph becomes empty after restoration.

Example

No code snippet is provided as the issue does not contain enough information about the codebase.

Notes

The issue seems to be specific to the Self Hosted (Docker) environment with collaboration mode disabled. The fix may involve modifying the frontend code to call the correct backend endpoint or handling the response correctly.

Recommendation

Apply workaround: Modify the top-right Restore button to call the correct backend endpoint (POST /console/api/apps/{app_id}/workflows/{workflow_id}/restore) when collaboration mode is disabled, as this is the expected behavior and the version item menu restore action already works correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

dify - ✅(Solved) Fix Workflow restore from top-right restore button clears draft when collaboration mode is disabled(1.14.0) [2 pull requests, 1 comments, 2 participants]