Project-bound users lost when cloning a project
Describe the bug If we export a project and then import it again into the same instance, then the users are not created (because they exist already) and thus the clone of the project does not have any project-bound users.
... but ...
If we instead add users that pre-existed to this set, then we can end up adding project-bound users from another project (i.e. from the original one which we are cloning). That means if the original project is deleted, then the users will be deleted and this our clone project gets its users removed. Also not good.
To Reproduce Steps to reproduce the behavior:
- Create a project with a password-less invite
- Use the invite to create a project-bound user
- Export the project
- Import the project again
- See that the cloned project has no users
Expected behavior In should be possible to access the annotations of all the original users in the project clone. So that would probably mean to create a new set of project-bound users and to re-map the annotations to them. However, that would mean that log entries referring to the old user IDs are no longer valid. So it would probably be better if project-bound users could retain their username in the clone - which would mean that we'd have to relax the need for username uniqueness in the users table from globally unique to unique within the context of a realm.
Please complete the following information:
- Version and build ID: 0.20.0-SNAPSHOT