mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 12:59:18 +08:00
When two workspace members each set their own credential as the default for the same provider, both rows ended up with is_default=True for the same (tenant_id, provider). The clear UPDATE was filtered by user_id, so it only reset the caller's own defaults and left other members' defaults intact. The consumer (`get_builtin_provider`) is tenant-scoped and picks an arbitrary winner via the created_at tiebreak when multiple defaults exist, producing user-visible inconsistencies. Drop user_id from the clear filter so default selection becomes properly tenant-scoped, matching `DatasourceProviderService.set_default_datasource_provider`. Adds a regression test that asserts the clear filter_by call uses tenant_id/provider but not user_id. Backport of equivalent fix on main to lts/1.13.x. |
||
|---|---|---|
| .. | ||
| commands | ||
| configs | ||
| controllers | ||
| core | ||
| dify_graph | ||
| enterprise/telemetry | ||
| events | ||
| extensions | ||
| factories | ||
| fields | ||
| libs | ||
| models | ||
| oss | ||
| repositories | ||
| services | ||
| tasks | ||
| tools | ||
| utils | ||
| __init__.py | ||
| .gitignore | ||
| conftest.py | ||