[PR #29972] fix: invalidate tool provider cache after MCP authentication #32632

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

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

State: closed
Merged: Yes


Summary

This PR fixes an issue where the tool_providers list API returned stale cached data after MCP authentication completed. Added cache invalidation calls in all auth paths (success, OAuth flow, and error handling) to ensure the Redis cache is cleared when provider state changes.
Fixes #29971
Fixes #29987

Screenshots

Before After
image image

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
**Original Pull Request:** https://github.com/langgenius/dify/pull/29972 **State:** closed **Merged:** Yes --- ## Summary This PR fixes an issue where the tool_providers list API returned stale cached data after MCP authentication completed. Added cache invalidation calls in all auth paths (success, OAuth flow, and error handling) to ensure the Redis cache is cleared when provider state changes. Fixes #29971 Fixes #29987 ## Screenshots | Before | After | |--------|-------| | <img width="834" height="1120" alt="image" src="https://github.com/user-attachments/assets/97d502f3-2efe-4ad7-95e9-99985bfcfa84" /> | <img width="406" height="713" alt="image" src="https://github.com/user-attachments/assets/abb2bcca-cb20-4219-b7dd-6890e3608082" />| ## 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
yindo added the pull-request label 2026-02-21 20:51:46 -05:00
yindo closed this issue 2026-02-21 20:51:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32632