dify icon indicating copy to clipboard operation
dify copied to clipboard

fix recreating users' default tenaunt relations when loading user

Open bowenliang123 opened this issue 1 year ago • 2 comments

  • fix bugs in load_user introduced by #2341
    1. skip auto creating default tenant in this method. for the reasons that
    • 1.1 it causes leak as it does not acquire locks to guarantee only one default tenant will be created
    • 1.2 it's not a right timing to create user's default tenant. A better way is to do it in register service.
    1. reuse existed available tenant for the user

Caused by 1.2. image

bowenliang123 avatar Feb 06 '24 06:02 bowenliang123

cc @crazywoola @takatost

bowenliang123 avatar Feb 06 '24 06:02 bowenliang123

We need to create a personal tenant as the owner when invited to another tenant. We need to make this logic before we can merge together.

takatost avatar Feb 06 '24 07:02 takatost