Deluge Adding User to profile via secondary email created duplicate account. Soft reset permissions on all apps.

Deluge Adding User to profile via secondary email created duplicate account. Soft reset permissions on all apps.

A second, duplicate, user account was created when the following code was used in an application.

sec_Profile_Name = thisapp.permissions.profileForUser(input.Secondary_Developer_Email);
if(sec_Profile_Name == "")
{
thisapp.permissions.assignUserInProfile(input.Secondary_Developer_Email,"TestProfile");
}

The user was already setup as a developer, so it appears that the profile was returned as null string, then a duplicate user account was added to the user's domain and to the application as a non-developer user under the "TestProfile" user group. (and showing up twice under both developers and "TestProfile" in the application in question)

This account has exactly the same username and email as the previous entry, but no permissions on the applications being developed.

As such, all applications that the user was developing are no longer accessible, even though their username is listed as a developer. The only way for them to regain access is for another developer to remove the bugged previous user account entry and re-add them as a developer.

Apps on dashboard still show up with developer status, but attempting to open them results application is not accessible error.

I am assuming that this occurred due to using a secondary email address attached to an account in the above code, which has caused this issue.

Has anyone else encountered this issue? Is there any fix found?

I am asking the community because I have already put in a ticket to support, but the ticket was closed without a response. I hope someone has seen this and knows of a way to fix without deleting and re-adding the user to every zoho application again. I also want to warn anyone that may be attempting to dynamically add users to profiles via email address of this serious bug!