From 3eea89f5a3233ab13345716b0304721aeb88aa44 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 16 Mar 2026 21:17:51 +0900 Subject: [PATCH] Fix JSON-RPC dispatcher callback params Reordered the parameters for the JSON-RPC dispatch callback to ensure the serializer and request id are passed in the correct positions. Updated the Func signature in JsonRpc2Dispatcher.cs to include the int id parameter before the CancellationToken, and adjusted the invocation/lambda in JsonRpc2.cs to match (method, ser, id, ct), preventing parameter mismatches when handling requests. --- WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs | 2 +- WelsonJS.Augmented/WelsonJS.Launcher/JsonRpc2Dispatcher.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs b/WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs index 05aded7..af9aaa0 100644 --- a/WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs +++ b/WelsonJS.Augmented/WelsonJS.Launcher/ApiEndpoints/JsonRpc2.cs @@ -74,7 +74,7 @@ namespace WelsonJS.Launcher.ApiEndpoints { await dispatcher.HandleAsync( body, - async (method, id, ser, ct) => + async (method, ser, id, ct) => { switch (method) { diff --git a/WelsonJS.Augmented/WelsonJS.Launcher/JsonRpc2Dispatcher.cs b/WelsonJS.Augmented/WelsonJS.Launcher/JsonRpc2Dispatcher.cs index 18341f3..deaee34 100644 --- a/WelsonJS.Augmented/WelsonJS.Launcher/JsonRpc2Dispatcher.cs +++ b/WelsonJS.Augmented/WelsonJS.Launcher/JsonRpc2Dispatcher.cs @@ -33,7 +33,7 @@ namespace WelsonJS.Launcher public async Task HandleAsync( string requestBody, - Func> dispatchMethodAsync, + Func> dispatchMethodAsync, CancellationToken ct) { if (string.IsNullOrEmpty(requestBody)) @@ -62,7 +62,7 @@ namespace WelsonJS.Launcher Method = method }; - return await dispatchMethodAsync(req.Method, id, ser, ct); + return await dispatchMethodAsync(req.Method, ser, id, ct); } catch (JsonRpc2Exception) {