From 2273d99406de768cd874b26156b184ca5f442b6d Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 28 Aug 2024 21:45:02 +0500 Subject: [PATCH] Fix space security (#6428) Signed-off-by: Denis Bykhov --- server/middleware/src/spaceSecurity.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/middleware/src/spaceSecurity.ts b/server/middleware/src/spaceSecurity.ts index eda833502f..9751a21a40 100644 --- a/server/middleware/src/spaceSecurity.ts +++ b/server/middleware/src/spaceSecurity.ts @@ -249,7 +249,7 @@ export class SpaceSecurityMiddleware extends BaseMiddleware implements Middlewar params: null } ctx.derived.txes.push(tx) - ctx.derived.targets.security = (it) => { + ctx.derived.targets['security' + tx._id] = (it) => { // TODO: I'm not sure it is called if (it._id === tx._id) { return targets @@ -383,7 +383,9 @@ export class SpaceSecurityMiddleware extends BaseMiddleware implements Middlewar await this.processTx(ctx, tx) const res = await this.provideTx(ctx, tx) for (const txd of ctx.derived.txes) { - await this.processTx(ctx, txd) + if (txd._id !== tx._id) { + await this.processTx(ctx, txd) + } } return res }