[PR #31863] fix: remove staleTime/gcTime overrides from trigger query hooks and use orpc contract #33437

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

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

State: closed
Merged: Yes


Summary

  • Remove staleTime: 0 and gcTime: 0 from useAllTriggerPlugins, useTriggerProviderInfo, and useTriggerPluginDynamicOptions
  • These overrides defeated TanStack Query caching, causing redundant GET /workspaces/current/triggers requests on every panel open/close in both workflow and chatflow modes
  • Hooks now use the global default (30 min staleTime); existing invalidateQueries calls already handle plugin install/uninstall

Closes #31858

Test plan

  • Open a workflow editor, click any node to open its panel, close it, reopen — verify only one network request to /workspaces/current/triggers is made
  • Open a chatflow editor, click nodes — verify the trigger API is not called repeatedly
  • Install/uninstall a trigger plugin — verify the trigger list refreshes correctly via invalidation
**Original Pull Request:** https://github.com/langgenius/dify/pull/31863 **State:** closed **Merged:** Yes --- ## Summary - Remove `staleTime: 0` and `gcTime: 0` from `useAllTriggerPlugins`, `useTriggerProviderInfo`, and `useTriggerPluginDynamicOptions` - These overrides defeated TanStack Query caching, causing redundant `GET /workspaces/current/triggers` requests on every panel open/close in both workflow and chatflow modes - Hooks now use the global default (30 min staleTime); existing `invalidateQueries` calls already handle plugin install/uninstall Closes #31858 ## Test plan - [ ] Open a workflow editor, click any node to open its panel, close it, reopen — verify only one network request to `/workspaces/current/triggers` is made - [ ] Open a chatflow editor, click nodes — verify the trigger API is not called repeatedly - [ ] Install/uninstall a trigger plugin — verify the trigger list refreshes correctly via invalidation
yindo added the pull-request label 2026-02-21 20:53:17 -05:00
yindo closed this issue 2026-02-21 20:53:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33437