{"record":{"id":"00fa0ba2b7ca21e2","repo":"dotnet/aspnetcore","slug":"the-message-type-s-is-not-supported-yet","errorCode":null,"errorMessage":"The message type %s is not supported yet.","messagePattern":"The message type (.+?) is not supported yet\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"src/SignalR/clients/java/signalr/core/src/main/java/com/microsoft/signalr/GsonHubProtocol.java","lineNumber":204,"sourceCode":"                        break;\n                    case STREAM_ITEM:\n                        if (resultToken != null) {\n                            Type returnType = binder.getReturnType(invocationId);\n                            try {\n                                result = gson.fromJson(resultToken, returnType != null ? returnType : Object.class);\n                            } catch (Exception ex) {\n                                argumentBindingException = ex;\n                            }\n                        }\n                        if (argumentBindingException != null) {\n                            hubMessages.add(new StreamBindingFailureMessage(invocationId, argumentBindingException));\n                        } else {\n                            hubMessages.add(new StreamItem(null, invocationId, result));\n                        }\n                        break;\n                    case STREAM_INVOCATION:\n                    case CANCEL_INVOCATION:\n                        throw new UnsupportedOperationException(String.format(\"The message type %s is not supported yet.\", messageType));\n                    case PING:\n                        hubMessages.add(PingMessage.getInstance());\n                        break;\n                    case CLOSE:\n                        if (error != null) {\n                            hubMessages.add(new CloseMessage(error));\n                        } else {\n                            hubMessages.add(new CloseMessage());\n                        }\n                        break;\n                    default:\n                        break;\n                }\n            }\n        } catch (IOException ex) {\n            throw new RuntimeException(\"Error reading JSON.\", ex);\n        }\n","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/294cab2f9b2e03af6b953820c7ab497c3c8b7ad9/src/SignalR/clients/java/signalr/core/src/main/java/com/microsoft/signalr/GsonHubProtocol.java#L186-L222","documentation":"The client-side GsonHubProtocol intentionally does not implement reception of STREAM_INVOCATION (type 4) or CANCEL_INVOCATION (type 5) because those are client-to-server messages. Receiving one means the server is misbehaving (sending a message type that only clients should send) and the protocol throws rather than silently ignoring it.","triggerScenarios":"A server erroneously dispatching a StreamInvocation or CancelInvocation to the client, or a tampered/incorrect stream that injects type 4/5 messages.","commonSituations":"Server bug dispatching the wrong direction, protocol version mismatch, a malicious or buggy intermediary, or testing with a fixture that sends client-only message types.","solutions":["Report/investigate the server: it should never send StreamInvocation or CancelInvocation to clients.","Upgrade both client and server to compatible SignalR versions.","If testing, ensure fixtures only send client-receivable types (Invocation, StreamItem, Completion, Ping, Close).","Inspect the wire for tampering if the server is known-good."],"exampleFix":"// test fixture before\nString msg = \"{\\\"type\\\":4,\\\"invocationId\\\":\\\"1\\\"}\\u001e\";\n\n// after (client-receivable type)\nString msg = \"{\\\"type\\\":1,\\\"target\\\":\\\"Do\\\",\\\"arguments\\\":[]}\\u001e\";","handlingStrategy":"fallback","validationCode":"// Ensure test fixtures only emit client-receivable types\nstatic final Set<Integer> CLIENT_RECEIVABLE = Set.of(1, 2, 3, 6, 7);\nboolean clientReceivable(int type) { return CLIENT_RECEIVABLE.contains(type); }","typeGuard":null,"tryCatchPattern":"try {\n  connection.start();\n} catch (RuntimeException e) {\n  if (e.getMessage().contains(\"not supported yet\")) {\n    // server is sending client-only message types; report server bug\n  }\n}","preventionTips":["Servers must never send StreamInvocation/CancelInvocation to clients.","Keep client and server on compatible versions.","Filter test fixtures to client-receivable message types."],"tags":["java","signalr","protocol","unsupported","message-type"],"analyzedSha":"294cab2f9b2e03af6b953820c7ab497c3c8b7ad9","analyzedAt":"2026-08-06T20:08:02.189Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}