[PR #30480] fix(web): ensure model providers data is always fresh #32840

Open
opened 2026-02-21 20:52:10 -05:00 by yindo · 0 comments
Owner

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

State: open
Merged: No


Summary

  • Set staleTime: 0 and gcTime: 0 for useModelProviders hook
  • Ensures model providers data is always fetched fresh after invalidation
  • Fixes issue where multiple model credentials may not display when added quickly

Root Cause

The useModelProviders hook was using the default 30-minute staleTime, which could cause stale data to be displayed when credentials are added in quick succession.

Test Plan

  • All existing frontend tests pass (8207 tests)
  • ESLint and type-check pass
  • Manual verification: rapidly add multiple credentials to the same model and verify all are displayed

Closes #30436

**Original Pull Request:** https://github.com/langgenius/dify/pull/30480 **State:** open **Merged:** No --- ## Summary - Set `staleTime: 0` and `gcTime: 0` for `useModelProviders` hook - Ensures model providers data is always fetched fresh after invalidation - Fixes issue where multiple model credentials may not display when added quickly ## Root Cause The `useModelProviders` hook was using the default 30-minute `staleTime`, which could cause stale data to be displayed when credentials are added in quick succession. ## Test Plan - [x] All existing frontend tests pass (8207 tests) - [x] ESLint and type-check pass - [ ] Manual verification: rapidly add multiple credentials to the same model and verify all are displayed Closes #30436
yindo added the pull-request label 2026-02-21 20:52:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32840