Workflow HTTP request node keeps resetting to default on its own - restore fails as well
Self Checks
- [X] This is only for bug report, if you would like to ask a quesion, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Pleas do not modify this template :) and fill in all the required fields.
Dify version
Version 0.6.5
Cloud or Self Hosted
Cloud
Steps to reproduce
See attached video.
- Define details of a HTTP request node
- Save and publish
- Reload the app
- HTTP request node has now reset
- Clicking the restore button shows old saved details of node, but clicking the restore button does not add it to the node again
- Manually adding the details to the http request node again does not work either
https://github.com/langgenius/dify/assets/6000238/fc521a32-3bdd-4ae1-b63d-beb255459bfb
✔️ Expected Behavior
Setting are retained and visible in panel
❌ Actual Behavior
Setting selv delete/hide on page reload
To address the issue with the HTTP request node settings not being properly saved and persisted across sessions in Dify version 0.6.5, focus on enhancing the persistence and loading mechanisms. This involves ensuring that changes to the HTTP request node settings are correctly persisted to a backend service, local storage, or another persistence layer, and that these settings are accurately loaded when the app initializes or when the HTTP request node is loaded.
Here's a strategy to resolve the issue:
-
Enhance Persistence Mechanism: Make sure the logic responsible for managing the state of the HTTP request node, possibly within a
useConfighook or similar, includes functionality to persist changes to settings. -
Improve Loading Mechanism: Modify the application's initialization or the HTTP request node's loading logic to correctly load persisted settings, ensuring they override the default settings.
-
Ensure Proper State Management: Utilize controlled components for form inputs to manage the state of the HTTP request node settings effectively, reflecting changes in the UI.
-
Debugging and Testing: Thoroughly test the application to ensure settings are correctly saved and restored. Pay attention to asynchronous operations and potential race conditions.
-
User Feedback: Implement mechanisms to inform users about the status of their settings, such as successful saves or errors.
Here's a conceptual example for enhancing the persistence mechanism within a React component or hook:
function useConfig(nodeId, initialData) {
const [data, setData] = useState(initialData);
// Update settings and persist changes
const updateSettings = async (newSettings) => {
setData(newSettings); // Update local state
await persistSettings(nodeId, newSettings); // Persist changes
};
// Load settings on hook initialization
useEffect(() => {
const loadSettings = async () => {
const savedSettings = await fetchSettings(nodeId);
if (savedSettings) {
setData(savedSettings); // Override defaults with saved settings
}
};
loadSettings();
}, [nodeId]);
return [data, updateSettings];
}
This example demonstrates integrating persistence logic into the state management of the HTTP request node. Adapt this to fit the actual architecture and data handling mechanisms used by Dify.
Details
Sources
- web/app/components/workflow/nodes/http/default.ts
- web/app/components/workflow/nodes/http/panel.tsx
- api/core/workflow/nodes/http_request/http_request_node.py
- web/app/components/app/configuration/dataset-config/settings-modal/index.tsx
- web/app/components/app/configuration/index.tsx
- api/config.py
- docker/docker-compose.yaml
- api/.env.example
- en/features/workflow/nodes/http-request.md
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
Same issue i am facing also!
Thanks for speaking up @Yash-1511! Hoping it will get some attention soon.
+1
FYI still confirmed to be an issue on 0.6.6 on managed solution.
I face the same issue too
It seems a frontend issue, when you add this http request pannel once, it auto saved works. But when you re-opened this pannel, the http method always init to POST, body always reset to None.
the new version 0.6.7 resolve this issue