File tree Expand file tree Collapse file tree
rivetkit-typescript/packages/rivetkit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1280,34 +1280,8 @@ export class ActorConnRaw {
12801280 }
12811281 } ,
12821282 ) ;
1283- const serializedLength = messageLength ( messageSerialized ) ;
1284- if (
1285- serializedLength > DEFAULT_MAX_INCOMING_MESSAGE_SIZE &&
1286- message . body . tag === "ActionRequest"
1287- ) {
1288- const actionId = Number ( message . body . val . id ) ;
1289- const inFlight = this . #takeActionInFlight( actionId ) ;
1290- const error = new errors . ActorError (
1291- "message" ,
1292- "incoming_too_long" ,
1293- "Incoming message too long" ,
1294- {
1295- maxSize : DEFAULT_MAX_INCOMING_MESSAGE_SIZE ,
1296- actualSize : serializedLength ,
1297- } ,
1298- ) ;
1299- logger ( ) . warn ( {
1300- msg : "rejecting oversized connection action request" ,
1301- actionId,
1302- actionName : inFlight . name ,
1303- actualSize : serializedLength ,
1304- maxSize : DEFAULT_MAX_INCOMING_MESSAGE_SIZE ,
1305- } ) ;
1306- inFlight . reject ( error ) ;
1307- this . #dispatchActorError( error ) ;
1308- return ;
1309- }
13101283 this . #websocket. send ( messageSerialized ) ;
1284+ const serializedLength = messageLength ( messageSerialized ) ;
13111285 logger ( ) . trace ( {
13121286 msg : "sent websocket message" ,
13131287 len : serializedLength ,
Original file line number Diff line number Diff line change @@ -707,16 +707,18 @@ describeDriverMatrix("Actor Conn", (driverTestConfig) => {
707707 await connection . dispose ( ) ;
708708 } ) ;
709709
710- test ( "should reject request exceeding maxIncomingMessageSize" , async ( c ) => {
710+ test ( "should reject request exceeding maxIncomingMessageSize via server " , async ( c ) => {
711711 const { client } = await setupDriverTest ( c , driverTestConfig ) ;
712712
713713 const handle = client . largePayloadConnActor . getOrCreate ( [
714714 "test-large-request-exceed" ,
715715 ] ) ;
716716 const connection = handle . connect ( ) ;
717717
718- // Create a payload that exceeds the default 64KB limit
719- // Each item is roughly 60 bytes, so 1500 items ≈ 90KB
718+ // Create a payload that exceeds the default 64KB limit.
719+ // Each item is roughly 60 bytes, so 1500 items ~ 90KB.
720+ // The server enforces the limit and closes the WebSocket
721+ // with reason "message.incoming_too_long".
720722 const items : string [ ] = [ ] ;
721723 for ( let i = 0 ; i < 1500 ; i ++ ) {
722724 items . push (
You can’t perform that action at this time.
0 commit comments