AlexStocks commented on code in PR #3594:
URL: https://github.com/apache/dubbo-go/pull/3594#discussion_r3726291355
##########
client/client.go:
##########
@@ -167,10 +167,13 @@ func (cli *Client) NewGenericService(referenceStr string,
opts ...ReferenceOptio
finalOpts = append(finalOpts, opts...)
genericService := generic.NewGenericService(referenceStr)
- _, err := cli.DialWithService(referenceStr, genericService,
finalOpts...)
+ connection, err := cli.DialWithService(referenceStr, genericService,
finalOpts...)
if err != nil {
return nil, err
}
+ if err :=
genericService.SetGenericType(connection.refOpts.Reference.Generic); err != nil
{
Review Comment:
[P1] 补上最终 generic 模式同步的主链路回归测试
这里是 `client.WithGenericType(...)` 真正影响 `InvokeWithType` 的唯一连接点,但现有新增测试只分别验证了
option 值和手工调用 `SetGenericType`,没有覆盖 `Client.NewGenericService` 返回对象的模式。我在当前
Head `b33339bc` 的隔离探针中删除这三行后,`go test ./client ./filter/generic
./filter/generic/generalizer ./internal` 仍全部通过;此时例如 `WithGenericType("gson")`
建立的底层引用使用 gson,而返回的 `GenericService` 仍按默认 Map 模式解析 typed result,正是本 PR
要修复的错误。请增加经过 `Client.NewGenericService` 的回归测试,至少断言返回服务继承最终 option 模式,并证明
`InvokeWithType` 按该模式解析;该测试应在删除本段同步逻辑时失败。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]