diff --git a/services/github/pod-github/src/sync/pullrequests.ts b/services/github/pod-github/src/sync/pullrequests.ts index c6ca78432b..94645c5a94 100644 --- a/services/github/pod-github/src/sync/pullrequests.ts +++ b/services/github/pod-github/src/sync/pullrequests.ts @@ -365,7 +365,7 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS const statuses = await this.provider.getStatuses(type?._id) const assignees = await this.getAssignees(pullRequestExternal) - const reviewers: PersonId[] = await this.getReviewers(pullRequestExternal) + const reviewers = await this.getPersonsFromId(await this.getReviewers(pullRequestExternal)) const latestReviews: LastReviewState[] = [] @@ -386,7 +386,7 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS this.stripGuestLink ), assignee: assignees[0] ?? null, - reviewers: reviewers.map((it: any) => it.person), + reviewers, draft: pullRequestExternal.isDraft, head: pullRequestExternal.headRef, base: pullRequestExternal.baseRef, diff --git a/services/github/pod-github/src/worker.ts b/services/github/pod-github/src/worker.ts index 027bb3ee9c..4482cd4a65 100644 --- a/services/github/pod-github/src/worker.ts +++ b/services/github/pod-github/src/worker.ts @@ -1580,6 +1580,7 @@ export class GithubWorker implements IntegrationManager { { error: { $ne: null }, url: null }, { limit: 50 } ) + if (withError.length === 0) { break } @@ -1590,6 +1591,26 @@ export class GithubWorker implements IntegrationManager { await ops.commit() } + while (true) { + if (this.closing) { + break + } + const withError = await derivedClient.findAll( + github.class.DocSyncInfo, + { error: { $ne: null } }, + { limit: 50 } + ) + + if (withError.length === 0) { + break + } + const ops = derivedClient.apply() + for (const d of withError) { + await ops.update(d, { error: null, needSync: '' }) + } + await ops.commit() + } + for (const { _class, mapper } of this.mappers) { if (this.closing) { break