From 1201015ab8744453735dc6874abb667c7e6d8e11 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 24 May 2026 03:36:18 +0200 Subject: [PATCH] Meta: Fix IPC generated try helper response unwrapping Generated try_* proxy methods for synchronous messages with a single output declared IPCErrorOr, but returned the whole response object instead of the output payload. That made helpers with named bool responses unusable once callers started using the fallible path. Share the same single-output accessor logic used by the infallible sync helpers so fallible generated helpers return the declared payload type. --- Meta/Generators/generate_ipc_definitions.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Meta/Generators/generate_ipc_definitions.py b/Meta/Generators/generate_ipc_definitions.py index 84f389e81e..0d4611775c 100644 --- a/Meta/Generators/generate_ipc_definitions.py +++ b/Meta/Generators/generate_ipc_definitions.py @@ -503,9 +503,17 @@ def write_proxy_method( else: out.write(f"\n return move(*{sync_call});") elif is_try: + if inner_return_type == "void": + success_return = "{}" + elif len(message.outputs) == 1: + output = message.outputs[0] + accessor = output.name if is_primitive_or_simple_type(output.type) else f"take_{output.name}" + success_return = f"result->{accessor}()" + else: + success_return = "move(*result)" out.write(f""" if (auto result = m_connection.template send_sync_but_allow_failure({call_args})) - return {"{}" if inner_return_type == "void" else "move(*result)"}; + return {success_return}; m_connection.shutdown(); return IPC::ErrorCode::PeerDisconnected;""") else: