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 }