UBERF-12214: Fix GitHub assignee update (#9515)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2025-07-10 13:23:03 +07:00
committed by GitHub
parent db7ad38848
commit 0514db9482
3 changed files with 13 additions and 8 deletions
+10 -8
View File
@@ -329,10 +329,12 @@ export class GithubWorker implements IntegrationManager {
.reverse()
.join(',') // TODO: Convert first, last name
const infos = await this.liveQuery.findOne(github.class.GithubUserInfo, { login: userInfo.login })
const normalizedLogin = userInfo.login.toLowerCase()
const infos = await this.liveQuery.findOne(github.class.GithubUserInfo, { login: normalizedLogin })
if (infos === undefined) {
await this._client.createDoc(github.class.GithubUserInfo, contact.space.Contacts, {
...userInfo
...userInfo,
login: normalizedLogin
})
}
@@ -542,15 +544,15 @@ export class GithubWorker implements IntegrationManager {
}
)
const infoData = response.user
const normalizedInfoData: Data<GithubUserInfo> = {
...infoData,
login: infoData.login?.toLowerCase()
}
if (info == null) {
await this._client.createDoc(
github.class.GithubUserInfo,
contact.space.Contacts,
infoData as Data<GithubUserInfo>
)
await this._client.createDoc(github.class.GithubUserInfo, contact.space.Contacts, normalizedInfoData)
} else {
await this._client.diffUpdate(info, {
...infoData
...normalizedInfoData
})
}
}