[PR #24532] fix: tool provider deadlock #30675

Closed
opened 2026-02-21 20:48:00 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/24532

State: closed
Merged: Yes


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

This pull request primarily removes the document download functionality from the dataset documents list in the web application. The associated UI elements, translation strings, and service logic for downloading documents have been deleted to streamline the codebase and user interface. Additionally, there are minor improvements to database session handling in the backend tool management code.

Removal of document download feature (most significant):

  • Deleted the document download button and related UI logic from the OperationAction component in list.tsx, including the import and use of useDocumentDownload and the RiDownloadLine icon. [1] [2] [3] [4]
  • Removed the download-related translation string 'Download File' from the English i18n resource file dataset-documents.ts.
  • Deleted the useDocumentDownload hook and related types from use-document.ts, including toast notification logic for download errors. [1] [2]

Backend improvements:

  • Updated session handling in tool_manager.py by switching from db.session to using Session(db.engine).no_autoflush for safer database operations in list_default_builtin_providers.
  • Improved session usage in get_builtin_provider to use no_autoflush context for consistency and reliability.

These changes help simplify the user interface and codebase, and improve backend reliability.

Screenshots

Before After
... ...

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 dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Related issues

**Original Pull Request:** https://github.com/langgenius/dify/pull/24532 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary This pull request primarily removes the document download functionality from the dataset documents list in the web application. The associated UI elements, translation strings, and service logic for downloading documents have been deleted to streamline the codebase and user interface. Additionally, there are minor improvements to database session handling in the backend tool management code. ### Removal of document download feature (most significant): * Deleted the document download button and related UI logic from the `OperationAction` component in `list.tsx`, including the import and use of `useDocumentDownload` and the `RiDownloadLine` icon. [[1]](diffhunk://#diff-8b2a06348088065537a8062ea966d288664d41b8656485cc561ed79b978d7acdL10) [[2]](diffhunk://#diff-8b2a06348088065537a8062ea966d288664d41b8656485cc561ed79b978d7acdL38) [[3]](diffhunk://#diff-8b2a06348088065537a8062ea966d288664d41b8656485cc561ed79b978d7acdL192) [[4]](diffhunk://#diff-8b2a06348088065537a8062ea966d288664d41b8656485cc561ed79b978d7acdL301-L325) * Removed the download-related translation string `'Download File'` from the English i18n resource file `dataset-documents.ts`. * Deleted the `useDocumentDownload` hook and related types from `use-document.ts`, including toast notification logic for download errors. [[1]](diffhunk://#diff-1f4074bc68465bc3de1dc8a9a19537eb49ff44935c63ce97c46af35cd7a2846cL11-R11) [[2]](diffhunk://#diff-1f4074bc68465bc3de1dc8a9a19537eb49ff44935c63ce97c46af35cd7a2846cL100-L114) ### Backend improvements: * Updated session handling in `tool_manager.py` by switching from `db.session` to using `Session(db.engine).no_autoflush` for safer database operations in `list_default_builtin_providers`. * Improved session usage in `get_builtin_provider` to use `no_autoflush` context for consistency and reliability. These changes help simplify the user interface and codebase, and improve backend reliability. ## Screenshots | Before | After | |--------|-------| | ... | ... | ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods ## Related issues - https://github.com/langgenius/dify/issues/24613
yindo added the pull-request label 2026-02-21 20:48:00 -05:00
yindo closed this issue 2026-02-21 20:48:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30675