Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Jan 28, 2025
1 parent 2535234 commit 9485632
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
46 changes: 27 additions & 19 deletions sdks/actor/runtime/src/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,26 +714,34 @@ export abstract class Actor<
return;
}

await handleMessageEvent(evt, this._metadata, conn, this.#config, {
onExecuteRpc: async (ctx, name, args) => {
return await this.#executeRpc(ctx, name, args);
await handleMessageEvent(
evt,
this._metadata,
conn,
this.#config,
{
onExecuteRpc: async (ctx, name, args) => {
return await this.#executeRpc(ctx, name, args);
},
onSubscribe: async (eventName, conn) => {
this.#addSubscription(eventName, conn);
},
onUnsubscribe: async (eventName, conn) => {
this.#removeSubscription(eventName, conn);
},
onError: (error) => {
const message = error.internal
? "internal error"
: "user error";
logger().warn(message, {
connectionId: conn?.id,
rpcRequestId: error.rpcRequestId,
rpcName: error.rpcName,
error,
});
},
},
onSubscribe: async (eventName, conn) => {
this.#addSubscription(eventName, conn);
},
onUnsubscribe: async (eventName, conn) => {
this.#removeSubscription(eventName, conn);
},
onError: (error) => {
const message = error.internal ? "internal error" : "user error";
logger().warn(message, {
connectionId: conn?.id,
rpcRequestId: error.rpcRequestId,
rpcName: error.rpcName,
error,
});
},
});
);
},
onClose: () => {
this.#removeConnection(conn);
Expand Down
2 changes: 1 addition & 1 deletion sdks/actor/runtime/src/event.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Metadata } from "@rivet-gg/actor-core";
import type * as wsToClient from "@rivet-gg/actor-protocol/ws/to_client";
import * as wsToServer from "@rivet-gg/actor-protocol/ws/to_server";
import type { WSMessageReceive } from "hono/ws";
Expand All @@ -6,7 +7,6 @@ import type { Connection, IncomingWebSocketMessage } from "./connection";
import * as errors from "./errors";
import { Rpc } from "./rpc";
import { assertUnreachable } from "./utils";
import type { Metadata } from "@rivet-gg/actor-core";

interface MessageEventConfig {
protocol: { maxIncomingMessageSize: number };
Expand Down

0 comments on commit 9485632

Please sign in to comment.