dify/api/tests
GareArc d4834ddd98
fix(tools): scope builtin tool default-credential clear to tenant
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.
2026-05-07 02:30:35 -07:00
..
fixtures/workflow fix(api): defer streaming response until referenced variables are updated (#30832) 2026-01-12 16:23:18 +08:00
integration_tests test: unit test cases for sub modules in core.app (except core.app.apps) (#32476) 2026-03-25 02:13:28 +08:00
test_containers_integration_tests chore: bump Dify to 1.13.3 and sandbox to 0.2.13 (#34079) 2026-03-25 20:03:15 +08:00
unit_tests fix(tools): scope builtin tool default-credential clear to tenant 2026-05-07 02:30:35 -07:00
__init__.py Initial commit 2023-05-15 08:51:32 +08:00
conftest.py refactor(workflow-file): move core.file to core.workflow.file (#32252) 2026-02-16 22:38:19 +08:00
workflow_test_utils.py refactor(dify_graph): introduce run_context and delegate child engine creation (#32964) 2026-03-05 14:31:28 +08:00