UBERF-10471: Fix Github miss status updates and allow to re-integrate existing repos (#8842)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2025-05-06 18:10:02 +05:00
committed by GitHub
parent 4007537b34
commit 58fc4453b4
6 changed files with 99 additions and 19 deletions
@@ -528,7 +528,7 @@ export class CommentSyncManager implements DocSyncManager {
}
const syncInfo = await this.client.findAll<DocSyncInfo>(github.class.DocSyncInfo, {
space: repo.githubProject,
repository: repo._id,
// repository: repo._id, // If we skip repository, we will find orphaned comments, so we could connect them on.
objectClass: chunter.class.ChatMessage,
url: { $in: comments.map((it) => (it.url ?? '').toLowerCase()) }
})
@@ -550,14 +550,19 @@ export class CommentSyncManager implements DocSyncManager {
lastModified
})
} else {
if (!deepEqual(existing.external, comment) || existing.externalVersion !== githubExternalSyncVersion) {
if (
!deepEqual(existing.external, comment) ||
existing.externalVersion !== githubExternalSyncVersion ||
existing.repository !== repo._id
) {
await derivedClient.diffUpdate(
existing,
{
needSync: '',
external: comment,
externalVersion: githubExternalSyncVersion,
lastModified
lastModified,
repository: repo._id
},
lastModified
)