Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UBERF-8504: Fix DocSyncInfo in transactions #6998

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/core/src/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ export class ApplyOperations extends TxOperations {
constructor (
readonly ops: TxOperations,
readonly scope?: string,
readonly measureName?: string
readonly measureName?: string,
isDerived?: boolean
) {
const txClient: Client = {
getHierarchy: () => ops.client.getHierarchy(),
Expand All @@ -460,7 +461,7 @@ export class ApplyOperations extends TxOperations {
return {}
}
}
super(txClient, ops.user)
super(txClient, ops.user, isDerived ?? false)
}

match<T extends Doc>(_class: Ref<Class<T>>, query: DocumentQuery<T>): ApplyOperations {
Expand Down
8 changes: 7 additions & 1 deletion services/github/model-github/src/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright © 2023 Hardcore Engineering Inc.
//

import core, { toIdMap, type AnyAttribute, type Ref, type Status } from '@hcengineering/core'
import core, { DOMAIN_TX, toIdMap, type AnyAttribute, type Ref, type Status } from '@hcengineering/core'
import {
tryMigrate,
tryUpgrade,
Expand Down Expand Up @@ -326,6 +326,12 @@ export const githubOperationPreTime: MigrateOperation = {
{
state: 'migrate-missing-states',
func: migrateMissingStates
},
{
state: 'remove-doc-sync-info-txes',
func: async (client) => {
await client.deleteMany(DOMAIN_TX, { objectClass: github.class.DocSyncInfo })
}
}
])
},
Expand Down