From 4c177f0cf187602188e8ab001e43e7762d744492 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 27 Jun 2026 12:00:38 +0200 Subject: [PATCH] fix(shadowsocks): send per-user Account for SS-2022 runtime AddUser SS-2022 user updates passed shadowsocks_2022.ServerConfig (the inbound-level config) as the gRPC user account. The core rejects it with "Unknown account type" because only shadowsocks_2022.Account implements AsAccount(), so live AddUser failed and renewed/reset/added users stayed inactive until the 30s auto-restart rebuilt the inbound from the DB. Use shadowsocks_2022.Account{Key: password} (the per-user type, matching xray-core's own multi-user builder) so changes apply immediately without a restart. Fixes #5597 --- internal/xray/api.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/xray/api.go b/internal/xray/api.go index 96a3dd1fc..921e77a93 100644 --- a/internal/xray/api.go +++ b/internal/xray/api.go @@ -502,9 +502,8 @@ func (x *XrayAPI) AddUser(Protocol string, inboundTag string, user map[string]an CipherType: ssCipherType, }) } else { - account = serial.ToTypedMessage(&shadowsocks_2022.ServerConfig{ - Key: password, - Email: userEmail, + account = serial.ToTypedMessage(&shadowsocks_2022.Account{ + Key: password, }) } case "hysteria":