From 4048cc8b01a73baceb95bc684817c7cad3c6e0c0 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Tue, 10 Jan 2023 10:42:05 +0000 Subject: [PATCH] Check the GitLab instance name when looking for existing connections (#617) * Check the GitLab instance name when looking for existing connections * changelog --- changelog.d/617.bugfix | 1 + src/Connections/GitlabRepo.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/617.bugfix diff --git a/changelog.d/617.bugfix b/changelog.d/617.bugfix new file mode 100644 index 00000000..d8d88539 --- /dev/null +++ b/changelog.d/617.bugfix @@ -0,0 +1 @@ +You can now add multiple GitLab connections to the same room with the same project path, if they are under different instances. \ No newline at end of file diff --git a/src/Connections/GitlabRepo.ts b/src/Connections/GitlabRepo.ts index ac0d3f42..09111cd7 100644 --- a/src/Connections/GitlabRepo.ts +++ b/src/Connections/GitlabRepo.ts @@ -206,7 +206,7 @@ export class GitLabRepoConnection extends CommandConnection c.roomId === roomId && c.path === connection.path); + const existing = existingConnections.find(c => c.roomId === roomId && c.instance.url === connection.instance.url && c.path === connection.path); if (existing) { throw new ApiError("A GitLab repo connection for this project already exists", ErrCode.ConflictingConnection, -1, {