diff --git a/packages/backend/src/managers/playground.ts b/packages/backend/src/managers/playground.ts index 596d830fa..2921a8371 100644 --- a/packages/backend/src/managers/playground.ts +++ b/packages/backend/src/managers/playground.ts @@ -215,9 +215,7 @@ export class PlayGroundManager { } q.response = result as ModelResponse; this.queries.set(query.id, q); - this.sendQueriesState().catch((err: unknown) => { - console.error('playground: unable to send the response to the frontend', err); - }); + this.sendQueriesState(); } }); }); @@ -226,7 +224,7 @@ export class PlayGroundManager { post_req.end(); this.queries.set(query.id, query); - await this.sendQueriesState(); + this.sendQueriesState(); return query.id; } @@ -241,10 +239,14 @@ export class PlayGroundManager { return Array.from(this.playgrounds.values()); } - async sendQueriesState() { - await this.webview.postMessage({ - id: MSG_NEW_PLAYGROUND_QUERIES_STATE, - body: this.getQueriesState(), - }); + sendQueriesState(): void { + this.webview + .postMessage({ + id: MSG_NEW_PLAYGROUND_QUERIES_STATE, + body: this.getQueriesState(), + }) + .catch((err: unknown) => { + console.error(`Something went wrong while emitting MSG_NEW_PLAYGROUND_QUERIES_STATE: ${String(err)}`); + }); } }