UBERF-7959: Fix async issues (#6409)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-08-28 11:51:20 +05:00
committed by GitHub
parent c2d0aad760
commit 4cce003364
27 changed files with 338 additions and 424 deletions
@@ -434,7 +434,7 @@ export class CommentSyncManager implements DocSyncManager {
project: GithubProject
): Promise<void> {
// No need to perform external sync for comments, so let's update marks
const tx = derivedClient.apply('comments_github')
const tx = derivedClient.apply('comments_github' + project._id)
for (const d of syncDocs) {
await tx.update(d, { externalVersion: githubExternalSyncVersion })
}
@@ -402,7 +402,7 @@ export abstract class IssueSyncManagerBase {
return true
})
const updateTodos = this.client.apply('todos')
const updateTodos = this.client.apply('todos' + account)
for (const [k, v] of Object.entries(todos)) {
await updateTodos.updateDoc(time.class.ToDo, time.space.ToDos, k as Ref<ToDo>, {
doneOn: v ? Date.now() : null
@@ -1302,7 +1302,7 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS
)
}
const tx = derivedClient.apply('pullrequests_github')
const tx = derivedClient.apply('pullrequests_github' + prj._id)
for (const d of syncDocs) {
await tx.update(d, { derivedVersion: githubDerivedSyncVersion })
}
@@ -560,7 +560,7 @@ export class ReviewCommentSyncManager implements DocSyncManager {
project: GithubProject
): Promise<void> {
// No need to perform external sync for reviews, so let's update marks
const tx = derivedClient.apply('reviews_github')
const tx = derivedClient.apply('reviews_github' + project._id)
for (const d of syncDocs) {
await tx.update(d, { externalVersion: githubExternalSyncVersion })
}
@@ -499,7 +499,7 @@ export class ReviewThreadSyncManager implements DocSyncManager {
): Promise<void> {
if (kind === 'externalVersion') {
// No need to perform external sync for review threads, so let's update marks
const tx = derivedClient.apply('review_threads_github')
const tx = derivedClient.apply('review_threads_github' + prj._id)
for (const d of syncDocs) {
await tx.update(d, { externalVersion: githubExternalSyncVersion })
}
@@ -545,7 +545,7 @@ export class ReviewThreadSyncManager implements DocSyncManager {
{ reviewThreadId: ext.id }
)
}
const tx = derivedClient.apply('reviewThread_github')
const tx = derivedClient.apply('reviewThread_github' + prj._id)
for (const d of syncDocs) {
await tx.update(d, { derivedVersion: githubDerivedSyncVersion })
}
@@ -473,7 +473,7 @@ export class ReviewSyncManager implements DocSyncManager {
project: GithubProject
): Promise<void> {
// No need to perform external sync for reviews, so let's update marks
const tx = derivedClient.apply('reviews_github')
const tx = derivedClient.apply('reviews_github' + project._id)
for (const d of syncDocs) {
await tx.update(d, { externalVersion: githubExternalSyncVersion })
}
+1 -1
View File
@@ -299,7 +299,7 @@ export async function deleteObjects (
objects: Doc[],
account: Ref<Account>
): Promise<void> {
const ops = client.apply('delete')
const ops = client.apply('delete' + account)
for (const object of objects) {
if (client.getHierarchy().isDerived(object._class, core.class.AttachedDoc)) {
const adoc = object as AttachedDoc