broadcast derived data

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-10-10 13:51:59 +02:00
parent 4f147640c5
commit 3c69fa7d11
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0

View File

@ -43,7 +43,7 @@ class Session implements Storage {
const derived = await this.storage.tx(tx) const derived = await this.storage.tx(tx)
this.manager.broadcast(this, this.token, { result: tx }) this.manager.broadcast(this, this.token, { result: tx })
for (const tx of derived) { for (const tx of derived) {
this.manager.broadcast(this, this.token, { result: tx }) this.manager.broadcast(null, this.token, { result: tx })
} }
} }
} }
@ -87,7 +87,7 @@ class SessionManager {
} }
} }
broadcast (from: Session, token: Token, resp: Response<any>): void { broadcast (from: Session | null, token: Token, resp: Response<any>): void {
const workspace = this.workspaces.get(token.workspace) const workspace = this.workspaces.get(token.workspace)
if (workspace === undefined) { if (workspace === undefined) {
throw new Error('internal: cannot find sessions') throw new Error('internal: cannot find sessions')