langgenius / langgenius/dify

ChatFlow page state is reset after navigating away and returning, causing ongoing tasks and user input to be lost

Open
#38,555 2 comments 1 reaction 0 assignees View on GitHub
🐞 bug feat:webapp project#dify
Dominant language
TypeScript
Stars
156k
Forks
24.6k
Avg merge
22h 9m
Merged PRs (30d)
610

Description

### Self Checks

- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
- [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones.
- [x] I confirm that I am using English to submit this report, otherwise it will be closed.
- [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- [x] Please do not modify this template :) and fill in all the required fields.

### Dify version

1.13.3

### Cloud or Self Hosted

Self Hosted (Docker)

### Steps to reproduce

1. Description

In ChatFlow, when a user navigates to another page and then returns, the page state is unexpectedly reset. The behavior is equivalent to a full page refresh.
As a result:
- Ongoing tasks disappear from the page;
- state is not preserved;
- Unsubmitted user input is cleared;
- Users must restart the conversation or re-enter their input.

This significantly impacts the user experience, especially when users switch between pages while interacting with ChatFlow.

2. Steps to Reproduce

Scenario 1: Ongoing Task Disappears After Page Switch
1) Open a ChatFlow page;
2) Enter a message and click Start Conversation;
3) Navigate to another page while the task is still processing;
4) Return to the ChatFlow page.

Scenario 2: Unsubmitted User Input Is Cleared After Page Switch
1) Open a ChatFlow page;
2) Enter text into the input field;
3) Do not click Start Conversation;
4) Navigate to another page;
5) Return to the ChatFlow page.

3. Impact

- Users cannot safely navigate to other pages while waiting for task completion;
- Conversation context may be lost;
- User-entered content is at risk of being lost;
- Long-running task scenarios are significantly impacted.

4. Severity
This issue causes loss of in-progress conversation state and user-entered data, significantly affecting ChatFlow usability and workflow continuity.

### ✔️ Expected Behavior

Scenario 1:
- The current conversation state should be preserved after page navigation;
- Ongoing tasks should continue processing normally;
- When users return to the page, the task status and results should be automatically restored and displayed.

Scenario 2:
- User input should be preserved after page navigation;
- Previously entered content should remain in the input field when returning to the page;
- Unsaved input should not be lost due to page switching.

### ❌ Actual Behavior

Scenario 1:
- The ChatFlow page is reset;
- The page state is the same as after a browser refresh;
- The ongoing task disappears;
- Users cannot view task progress or final results;
- Users must start a new conversation.

Scenario 2:
- The ChatFlow page is reset;
- The input field is cleared;
- The user's unsaved input is lost.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing both ChatFlow navigation scenarios: leave during an ongoing task and leave with unsubmitted input, then return to the page. Compare the returned page with the expected conversation state, task progress or results, and preserved input; the issue is done when both states survive page navigation without requiring a new conversation.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.