Merge branch 'hs/fix-github-grants-failing-2' into hs/hotfix-2

This commit is contained in:
Half-Shot 2023-03-24 15:32:01 +00:00
commit bd2bad495e
2 changed files with 3 additions and 2 deletions

1
changelog.d/672.bugfix Normal file
View File

@ -0,0 +1 @@
Fix GitHub repo connections not always applying state updates.

View File

@ -568,14 +568,14 @@ export class GitHubRepoConnection extends CommandConnection<GitHubRepoConnection
return this.state.priority || super.priority; return this.state.priority || super.priority;
} }
public async ensureGrant(sender?: string, state = this.state) { public async ensureGrant(sender?: string, state = { org: this.org, repo: this.repo }) {
await this.grantChecker.assertConnectionGranted(this.roomId, state, sender); await this.grantChecker.assertConnectionGranted(this.roomId, state, sender);
} }
protected async validateConnectionState(content: unknown) { protected async validateConnectionState(content: unknown) {
const state = GitHubRepoConnection.validateState(content); const state = GitHubRepoConnection.validateState(content);
// Validate the permissions of this state // Validate the permissions of this state
await this.ensureGrant(undefined, state); await this.ensureGrant(undefined, { org: this.org, repo: this.repo });
return state; return state;
} }