{"record":{"id":"6bd479f866abd9d0","repo":"dotnet/aspnetcore","slug":"invalid-payload-for-ack-message","errorCode":null,"errorMessage":"Invalid payload for Ack message.","messagePattern":"Invalid payload for Ack message\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/SignalR/clients/ts/signalr-protocol-msgpack/src/MessagePackHubProtocol.ts","lineNumber":267,"sourceCode":"                result = properties[4];\n                break;\n        }\n\n        const completionMessage: CompletionMessage = {\n            error,\n            headers,\n            invocationId: properties[2],\n            result,\n            type: MessageType.Completion,\n        };\n\n        return completionMessage;\n    }\n\n    private _createAckMessage(properties: any[]): HubMessage {\n        // check minimum length to allow protocol to add items to the end of objects in future releases\n        if (properties.length < 1) {\n            throw new Error(\"Invalid payload for Ack message.\");\n        }\n\n        return {\n            sequenceId: properties[1],\n            type: MessageType.Ack,\n        } as HubMessage;\n    }\n\n    private _createSequenceMessage(properties: any[]): HubMessage {\n        // check minimum length to allow protocol to add items to the end of objects in future releases\n        if (properties.length < 1) {\n            throw new Error(\"Invalid payload for Sequence message.\");\n        }\n\n        return {\n            sequenceId: properties[1],\n            type: MessageType.Sequence,\n        } as HubMessage;","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/SignalR/clients/ts/signalr-protocol-msgpack/src/MessagePackHubProtocol.ts#L249-L285","documentation":"Thrown by _createAckMessage when the decoded properties array has fewer than 1 element — i.e. the type itself is missing. Ack messages ([MessageType.Ack, sequenceId]) participate in the reliable/reconnect protocol, so this guard defends against a degenerate frame. Like the Ping guard, it is effectively a near-unreachable defensive check because the type was already read to dispatch here.","triggerScenarios":"A frame whose first element matched MessageType.Ack but whose array length is reported as 0 by the decoder — only possible with a misbehaving decoder or corrupted buffer; custom/patched msgpack.","commonSituations":"Not normally reachable; appears with corrupted reliable-protocol buffers or an incompatible decoder; rare in production.","solutions":["Treat as unrecoverable: log and reconnect.","Ensure reliable messaging (Ack/Sequence) is supported on both ends at the same protocol version.","Verify @msgpack/msgpack version is the supported one and not overridden.","Capture frame bytes for diagnosis."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const messages = protocol.parseMessages(buffer, logger);\n} catch (e) {\n  if (/Ack message/.test(e.message)) {\n    logger.log(LogLevel.Error, 'Degenerate Ack frame; reconnecting.');\n    await connection.start();\n  } else throw e;\n}","preventionTips":["Treat as unrecoverable corruption (the guard is defensive and near-unreachable).","Ensure reliable-messaging support and version alignment if using Ack/Sequence.","Do not mutate the parsed ArrayBuffer concurrently."],"tags":["messagepack","ack-message","reliable","validation","parsing"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}