Skip to content

[1.15.0] Inviting an existing workspace owner does not add them as a pending member #38048

Description

@kurokobo

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.15.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Note

This has not been fully verified in a production environment. It was discovered while investigating test behavior and reviewing the source code.

  1. Create a workspace (Workspace A) with an owner account (Account A). The owner account
    is created with ACTIVE status.
  2. Log in as a different account (Account B) that is an admin or owner of another
    workspace (Workspace B).
  3. Go to Preferences > Members and invite Account A by email.
  4. The invitation appears to succeed and an invitation URL is returned.
  5. Check the member list of Workspace B.

✔️ Expected Behavior

The invited account appears in the member list with pending status, and the user can join the workspace by visiting the invitation URL.

❌ Actual Behavior

The invited account does not appear in the member list at all — not even as pending.
The invitation URL is technically valid, but unless the user visits it manually, the workspace membership is never established.

Additional Information

In services/account_service.py, RegisterService.invite_new_member has the following
condition for existing accounts:

if not ta and (account.status == AccountStatus.PENDING or dify_config.RBAC_ENABLED):
    TenantService.create_tenant_member(tenant, account, session, tenant_join_role)

When the invitee already has an ACTIVE account (e.g. a workspace owner) and RBAC_ENABLED is False (the default), this condition evaluates to False and create_tenant_member is never called.
As a result, no TenantAccountJoin record is created, so the user does not appear in the member list.
The API still returns result: "success" and generates an invitation token, making the failure invisible to the caller.

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions