mirror of
https://github.com/langgenius/dify.git
synced 2026-05-09 04:36:31 +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. |
||
|---|---|---|
| .. | ||
| api_tools_manage_service.py | ||
| builtin_tools_manage_service.py | ||
| mcp_tools_manage_service.py | ||
| tool_labels_service.py | ||
| tools_manage_service.py | ||
| tools_transform_service.py | ||
| workflow_tools_manage_service.py | ||