From a45fecaf69925c757bacdafa43f8cbba89b5af20 Mon Sep 17 00:00:00 2001 From: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> Date: Sun, 24 Apr 2022 11:13:30 +0600 Subject: [PATCH] Fix modifiedOn collection inner tx (#1504) Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com> --- server/middleware/src/modified.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/middleware/src/modified.ts b/server/middleware/src/modified.ts index 40295ef5eb..162022271a 100644 --- a/server/middleware/src/modified.ts +++ b/server/middleware/src/modified.ts @@ -13,7 +13,7 @@ // limitations under the License. // -import core, { Doc, ServerStorage, Timestamp, Tx, TxCreateDoc } from '@anticrm/core' +import core, { AttachedDoc, Doc, ServerStorage, Timestamp, Tx, TxCollectionCUD, TxCreateDoc } from '@anticrm/core' import { Middleware, SessionContext, TxMiddlewareResult } from '@anticrm/server-core' import { BaseMiddleware } from './base' @@ -37,6 +37,10 @@ export class ModifiedMiddleware extends BaseMiddleware implements Middleware { createTx.attributes.createOn = tx.modifiedOn } } + if (this.storage.hierarchy.isDerived(tx._class, core.class.TxCollectionCUD)) { + const coltx = tx as TxCollectionCUD + coltx.tx.modifiedOn = tx.modifiedOn + } const res = await this.provideTx(ctx, tx) return [res[0], res[1], res[2]] }