mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Check the GitLab instance name when looking for existing connections (#617)
* Check the GitLab instance name when looking for existing connections * changelog
This commit is contained in:
parent
a5ea88578c
commit
4048cc8b01
1
changelog.d/617.bugfix
Normal file
1
changelog.d/617.bugfix
Normal file
@ -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.
|
@ -206,7 +206,7 @@ export class GitLabRepoConnection extends CommandConnection<GitLabRepoConnection
|
||||
const stateEventKey = `${validData.instance}/${validData.path}`;
|
||||
const connection = new GitLabRepoConnection(roomId, stateEventKey, as, validData, tokenStore, instance);
|
||||
const existingConnections = getAllConnectionsOfType(GitLabRepoConnection);
|
||||
const existing = existingConnections.find(c => 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, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user