Skip to content

refactor(api): extract account login service and consolidate adapters - #41184

Open
41tair wants to merge 1 commit into
langgenius:mainfrom
41tair:refactor/api-016
Open

refactor(api): extract account login service and consolidate adapters#41184
41tair wants to merge 1 commit into
langgenius:mainfrom
41tair:refactor/api-016

Conversation

@41tair

@41tair 41tair commented Aug 24, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

part of #39993

blocked by #40772
after 40772 merged we should update the FeatureService part

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and vp staged (frontend) to appease the lint gods

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. refactor labels Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-08-24 12:19:04.029993162 +0000
+++ /tmp/pyrefly_pr.txt	2026-08-24 12:18:55.890914411 +0000
@@ -785,25 +785,25 @@
 ERROR Generator function should return `Generator` [bad-return]
   --> tests/test_containers_integration_tests/repositories/test_workflow_run_repository.py:89:56
 ERROR Object of class `NoneType` has no attribute `open_id` [missing-attribute]
-   --> tests/test_containers_integration_tests/services/test_account_service.py:489:16
+   --> tests/test_containers_integration_tests/services/test_account_service.py:361:16
 ERROR Argument `list[str]` is not assignable to parameter `roles` with type `list[TenantAccountRole]` in function `services.account_service.TenantService.has_roles` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:1314:45
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1093:45
 ERROR Object of class `NoneType` has no attribute `role` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:1670:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1449:16
 ERROR Object of class `NoneType` has no attribute `role` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:1726:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1505:16
 ERROR Object of class `NoneType` has no attribute `role` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:1727:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1506:16
 ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:1851:16
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1630:16
 ERROR Argument `dict[str, str | dict[str, bool]]` is not assignable to parameter `value` with type `TenantCustomConfigDict` in function `models.account.Tenant.custom_config_dict` [bad-argument-type]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2021:37
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1800:37
 ERROR TypedDict `TenantCustomConfigDict` does not have key `theme` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2029:33
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1808:33
 ERROR TypedDict `TenantCustomConfigDict` does not have key `language` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2030:33
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1809:33
 ERROR TypedDict `TenantCustomConfigDict` does not have key `feature_flags` [bad-typed-dict-key]
-    --> tests/test_containers_integration_tests/services/test_account_service.py:2031:33
+    --> tests/test_containers_integration_tests/services/test_account_service.py:1810:33
 ERROR Argument `dict[str, AppMode | str] | dict[str, str]` is not assignable to parameter `args` with type `AdvancedPromptTemplateArgs` in function `services.advanced_prompt_template_service.AdvancedPromptTemplateService.get_prompt` [bad-argument-type]
    --> tests/test_containers_integration_tests/services/test_advanced_prompt_template_service.py:718:63
 ERROR Argument `dict[str, AppMode | str]` is not assignable to parameter `args` with type `AdvancedPromptTemplateArgs` in function `services.advanced_prompt_template_service.AdvancedPromptTemplateService.get_prompt` [bad-argument-type]
@@ -3426,38 +3426,6 @@
    --> tests/unit_tests/controllers/console/app/workflow_draft_variables_test.py:137:47
 ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
   --> tests/unit_tests/controllers/console/auth/test_forgot_password.py:29:9
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:234:16
-ERROR Cannot index into `Mapping[str, object]` [bad-index]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:234:37
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:235:16
-ERROR Cannot index into `Mapping[str, object]` [bad-index]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:235:37
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:265:16
-ERROR Cannot index into `Mapping[str, object]` [bad-index]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:265:37
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:266:16
-ERROR Cannot index into `Mapping[str, object]` [bad-index]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:266:37
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:422:16
-ERROR Cannot index into `Mapping[str, object]` [bad-index]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:422:37
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:423:16
-ERROR Cannot index into `Mapping[str, object]` [bad-index]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:423:37
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:609:16
-ERROR Cannot index into `Mapping[str, object]` [bad-index]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:609:37
-ERROR `None` is not subscriptable [unsupported-operation]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:610:16
-ERROR Cannot index into `Mapping[str, object]` [bad-index]
-   --> tests/unit_tests/controllers/console/auth/test_login_logout.py:610:37
 ERROR Object of class `RequestError` has no attribute `response` [missing-attribute]
    --> tests/unit_tests/controllers/console/auth/test_oauth.py:287:9
 ERROR Object of class `RequestError` has no attribute `response` [missing-attribute]
@@ -8663,13 +8631,13 @@
 ERROR Object of class `NoneType` has no attribute `get_data` [missing-attribute]
    --> tests/unit_tests/services/test_audio_service.py:806:16
 ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
-    --> tests/unit_tests/services/test_billing_service.py:2076:41
+    --> tests/unit_tests/services/test_billing_service.py:2103:41
 ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
-    --> tests/unit_tests/services/test_billing_service.py:2085:41
+    --> tests/unit_tests/services/test_billing_service.py:2112:41
 ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
-    --> tests/unit_tests/services/test_billing_service.py:2098:41
+    --> tests/unit_tests/services/test_billing_service.py:2125:41
 ERROR Argument `BillingInfo` is not assignable to parameter `result` with type `dict[Unknown, Unknown]` in function `TestBillingServiceSubscriptionInfoDataType._assert_billing_info_types` [bad-argument-type]
-    --> tests/unit_tests/services/test_billing_service.py:2109:41
+    --> tests/unit_tests/services/test_billing_service.py:2136:41
 ERROR Argument `FakeRepo` is not assignable to parameter `workflow_run_repo` with type `APIWorkflowRunRepository | None` in function `services.retention.workflow_run.clear_free_plan_expired_workflow_run_logs.WorkflowRunCleanup.__init__` [bad-argument-type]
    --> tests/unit_tests/services/test_clear_free_plan_expired_workflow_run_logs.py:127:49
 ERROR Class member `FailingRepo.delete_runs_with_related_by_ids` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]

@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 61.01% 61.43% +0.42%
Strict coverage 60.60% 61.02% +0.42%
Typed symbols 41,736 42,035 +299
Untyped symbols 26,851 26,568 -283
Modules 3243 3240 -3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant