Add tag process fixes (#10561)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2026-02-26 14:46:19 +05:00
committed by GitHub
parent 93bce6207b
commit b116e711f8
2 changed files with 74 additions and 5 deletions
@@ -323,11 +323,20 @@ export async function AddTag (
res.push(tx)
const card = control.cache.get(execution.card)
if (card === undefined) throw processError(process.error.ObjectNotFound, { _id: execution.card })
if (control.client.getHierarchy().hasMixin(card, tagId)) {
return { txes: res, rollback: [], context: null }
}
const cardWithMixin =
card !== undefined ? TxProcessor.updateMixin4Doc(control.client.getHierarchy().clone(card), tx) : undefined
if (control.client.getHierarchy().hasMixin(card, tagId)) {
return {
txes: res,
rollback: [],
context: [
{
_id: execution.card,
value: cardWithMixin
}
]
}
}
const rollback: Tx[] = [
control.client.txFactory.createTxUpdateDoc(_process.masterTag, execution.space, execution.card, {