Skip to content

Commit

Permalink
Revert await fixes for unawaited promises
Browse files Browse the repository at this point in the history
  • Loading branch information
stefl committed Oct 29, 2024
1 parent e37190a commit 12add47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions apps/nextjs/src/app/api/chat/webActionsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export const createWebActionsPlugin: PluginCreator = (
prisma,
SafetyViolations,
);
await enqueue(heliconeErrorMessage);
enqueue(heliconeErrorMessage);
}

if (error instanceof Error) {
await enqueue({
enqueue({
type: "error",
message: error.message,
value: `Sorry, an error occurred: ${error.message}`,
Expand Down Expand Up @@ -80,7 +80,7 @@ export const createWebActionsPlugin: PluginCreator = (
} catch (error) {
if (error instanceof UserBannedError) {
log.info("User is banned, queueing account lock message");
await enqueue({
enqueue({
type: "action",
action: "SHOW_ACCOUNT_LOCKED",
});
Expand Down
2 changes: 1 addition & 1 deletion packages/aila/src/core/chat/AilaChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export class AilaChat implements AilaChatService {
invariant(responseText, "Response text not set");
await this._generation.complete({ status, responseText });
}
await this._generation.persist(status);
this._generation.persist(status);
}

private async persistChat() {
Expand Down
4 changes: 2 additions & 2 deletions packages/aila/src/core/chat/AilaStreamHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class AilaStreamHandler {
await this.readFromStream();
}
} catch (e) {
await this.handleStreamError(e);
this.handleStreamError(e);
log.info("Stream error", e, this._chat.iteration, this._chat.id);
} finally {
this._isStreaming = false;
Expand Down Expand Up @@ -109,7 +109,7 @@ export class AilaStreamHandler {
for (const plugin of this._chat.aila.plugins ?? []) {
await plugin.onStreamError?.(error, {
aila: this._chat.aila,
enqueue: (patch) => this._chat.enqueue(patch),
enqueue: this._chat.enqueue,
});
}

Expand Down

0 comments on commit 12add47

Please sign in to comment.