XiaoFeiASK commented on issue #3472:
URL: https://github.com/apache/dubbo-go/issues/3472#issuecomment-5044147464

   # **问题(filter相关)**
   
   当前 Generic 调用对 generic mode 的处理不够严格:传入未知 mode 时,部分路径会静默 fallback 到默认 Map 
模式继续执行。
   这会导致配置错误不容易被发现,例如用户误写了 generic=bad-type,调用仍可能继续按 generic=true 
执行,后续出现参数或返回值转换问题时很难定位。
   同时,Typed Result、Triple generic 判断和异常识别能力还不完整,需要在严格 mode 解析的基础上继续补齐。
   # 方案
   采用分阶段实现:
   先收紧 generic mode 校验,保证错误配置能明确失败;
   再基于统一的 mode 解析逻辑,补齐 typed result、`InvokeWithType`、Triple 判断和 
`GenericException`。
   合法 mode 统一为:
   
   - `true`
   - `gson`
   - `bean`
   - `protobuf-json`
   
   `protobuf` 作为 legacy compatibility value 保留,不作为推荐值;其他未知值返回明确错误。
   # 实施计划
   PR-1:严格处理 Generic Mode
   
   - 移除未知 mode 的静默 fallback。
   - 让 `getGeneralizer` 返回明确错误。
   - Consumer / Provider 调用链传递非法 mode 错误。
   - 保持 `generic=false` 关闭泛化的原有语义。
   - 保留 `protobuf` 作为 legacy compatibility value。
   - 补充非法 generic mode 测试。
   
   PR-2:完善 Typed Result 和公共能力
   
   - 补齐 `InvokeWithType` 的 generic mode 感知能力,或对不支持的 mode 返回明确错误。
   - 明确 `OnResponse` 对 typed reply 的行为和错误处理。
   - 支持 `true` / `gson` / `bean` / `protobuf-json` 的 typed result 行为说明和测试。
   - 同步 Triple generic mode 判断,加入 `bean`,保留 `protobuf` legacy 兼容策略。
   - 暴露 `GenericException` 类型别名。
   - 补充 generalizer 行为说明和 typed result / 异常识别测试。


-- 
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]

Reply via email to