mirror of
https://github.com/langgenius/dify.git
synced 2026-05-08 11:47:35 +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. |
||
|---|---|---|
| .. | ||
| fixtures/workflow | ||
| integration_tests | ||
| test_containers_integration_tests | ||
| unit_tests | ||
| __init__.py | ||
| conftest.py | ||
| workflow_test_utils.py | ||