Migration owner list displays duplicate organizations when user is a member of multiple teams in each organization #4999

Closed
opened 2025-11-02 06:10:34 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @argentini on GitHub (Mar 4, 2020).

  • Gitea version (or commit ref): 1.11.1, 1.12
  • Git version: 2.25
  • Operating system: Windows
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When migrating a repository the owner dropdown menu shows organizations twice. This occurs when a user is a member of multiple teams in an organization. It appears that the owner list generates org entries based on team memberships without filtering by distinct org.

In testing I was also an owner, so it may be showing all "owned" orgs and all "team" orgs (thus showing each org twice).

Screenshots

migration-org-dupes

Originally created by @argentini on GitHub (Mar 4, 2020). - Gitea version (or commit ref): 1.11.1, 1.12 - Git version: 2.25 - Operating system: Windows - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [x] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ## Description When migrating a repository the owner dropdown menu shows organizations twice. This occurs when a user is a member of multiple teams in an organization. It appears that the owner list generates org entries based on team memberships without filtering by distinct org. In testing I was also an owner, so it may be showing all "owned" orgs and all "team" orgs (thus showing each org twice). ## Screenshots ![migration-org-dupes](https://user-images.githubusercontent.com/1504331/75899251-4c893b00-5e09-11ea-872d-edb1e500ce00.jpg)
GiteaMirror added the type/bug label 2025-11-02 06:10:34 -06:00
Author
Owner

@guillep2k commented on GitHub (Mar 4, 2020):

Maybe two workers took the task?

@guillep2k commented on GitHub (Mar 4, 2020): Maybe two workers took the task?
Author
Owner

@zeripath commented on GitHub (Mar 4, 2020):

I think this might be a bug specific to 1.11.1 - can you replicate on try?

@zeripath commented on GitHub (Mar 4, 2020): I think this might be a bug specific to 1.11.1 - can you replicate on try?
Author
Owner

@argentini commented on GitHub (Mar 4, 2020):

It doesn't do that on the try website. I had tested that and put it in the description when I posted the bug. I'd feel better knowing that it was explicitly fixed in 1.12 :)

@argentini commented on GitHub (Mar 4, 2020): It doesn't do that on the try website. I had tested that and put it in the description when I posted the bug. I'd feel better knowing that it was explicitly fixed in 1.12 :)
Author
Owner

@zeripath commented on GitHub (Mar 4, 2020):

I can't replicate it on the release/v1.11 branch either - so I think it's fixed.

@zeripath commented on GitHub (Mar 4, 2020): I can't replicate it on the release/v1.11 branch either - so I think it's fixed.
Author
Owner

@chrissyschoolshoes commented on GitHub (Mar 5, 2020):

I'm having the same problem.

I'm running the tagged release version 1.11.1 too and the organizations I've created appear twice in the list when assigning the owner for a new repo.

I'm running on Debian 10.

@chrissyschoolshoes commented on GitHub (Mar 5, 2020): I'm having the same problem. I'm running the tagged release version 1.11.1 too and the organizations I've created appear twice in the list when assigning the owner for a new repo. I'm running on Debian 10.
Author
Owner

@zeripath commented on GitHub (Mar 5, 2020):

could either of you try on the 1.11 branch to see if it is already fixed?

@zeripath commented on GitHub (Mar 5, 2020): could either of you try on the 1.11 branch to see if it is already fixed?
Author
Owner

@chrissyschoolshoes commented on GitHub (Mar 6, 2020):

Ok, so I cloned release/v1.11, built it and ran it and I cannot reproduce the problem, so it could well be fixed.

But, is there a way I can remove the duplicate organizations I can see in the version I'm currently running?

@chrissyschoolshoes commented on GitHub (Mar 6, 2020): Ok, so I cloned release/v1.11, built it and ran it and I cannot reproduce the problem, so it could well be fixed. But, is there a way I can remove the duplicate organizations I can see in the version I'm currently running?
Author
Owner

@zeripath commented on GitHub (Mar 6, 2020):

just update to 1.11.2 as soon as it is built. There were several critical issues in 1.11.1 and multiple security bugs have been fixed in 1.11.2.

@zeripath commented on GitHub (Mar 6, 2020): just update to 1.11.2 as soon as it is built. There were several critical issues in 1.11.1 and multiple security bugs have been fixed in 1.11.2.
Author
Owner

@chrissyschoolshoes commented on GitHub (Mar 6, 2020):

Ok will do, thanks.

@chrissyschoolshoes commented on GitHub (Mar 6, 2020): Ok will do, thanks.
Author
Owner

@argentini commented on GitHub (Mar 7, 2020):

Upgraded to 1.11.2 tonight and the bug is still present. But I think I figured what what's happening.

I'm the owner of both organizations. Each org has two teams: owners and developers. I was already the only user in the owners team, but I had also added myself to the developers team. When I do this I see both orgs listed twice as choices in the migration screen. When I remove myself from the developers teams (so I'm just in the owners team) I only see them once!

So, it looks like there's a bug in the migration screen's "owner" dropdown menu whereby it iterates the orgs I have access to based on team membership, without using a distinct filter on the orgs.

@argentini commented on GitHub (Mar 7, 2020): **Upgraded to 1.11.2 tonight and the bug is still present. But I think I figured what what's happening.** I'm the owner of both organizations. Each org has two teams: _owners_ and _developers_. I was already the only user in the _owners_ team, but I had also added myself to the _developers_ team. When I do this I see both orgs listed twice as choices in the migration screen. When I remove myself from the _developers_ teams (so I'm just in the _owners_ team) I only see them once! So, it looks like there's a bug in the migration screen's "owner" dropdown menu whereby it iterates the orgs I have access to based on team membership, without using a distinct filter on the orgs.
Author
Owner

@zeripath commented on GitHub (Mar 7, 2020):

Ah thanks for the clarification!

Would it be possible to update the issue description and/or title?

@zeripath commented on GitHub (Mar 7, 2020): Ah thanks for the clarification! Would it be possible to update the issue description and/or title?
Author
Owner

@dacheng-gao commented on GitHub (Mar 25, 2020):

And repository owner list displays duplicate organizations when user is a member of multiple teams in each organization, too.

Gitea V1.11.3.

@dacheng-gao commented on GitHub (Mar 25, 2020): And repository owner list displays duplicate organizations when user is a member of multiple teams in each organization, too. Gitea V1.11.3.
Author
Owner

@lunny commented on GitHub (Sep 18, 2020):

I cannot reproduce this on release/v1.12 with mssql docker image. @argentini @SuccessGo Could you confirm this again?

@lunny commented on GitHub (Sep 18, 2020): I cannot reproduce this on release/v1.12 with mssql docker image. @argentini @SuccessGo Could you confirm this again?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4999