send attach events before result

This commit is contained in:
Karl Seguin
2025-03-04 12:57:25 +08:00
committed by Pierre Tachoire
parent a3e2b5246e
commit fbb0e675f5

View File

@@ -134,10 +134,6 @@ fn createTarget(cmd: anytype) !void {
); );
try page.start(aux_data); try page.start(aux_data);
try cmd.sendResult(.{
.targetId = target_id,
}, .{});
// send targetCreated event // send targetCreated event
// TODO: should this only be sent when Target.setDiscoverTargets // TODO: should this only be sent when Target.setDiscoverTargets
// has been enabled? // has been enabled?
@@ -154,6 +150,10 @@ fn createTarget(cmd: anytype) !void {
// only if setAutoAttach is true? // only if setAutoAttach is true?
try doAttachtoTarget(cmd, target_id); try doAttachtoTarget(cmd, target_id);
bc.target_id = target_id; bc.target_id = target_id;
try cmd.sendResult(.{
.targetId = target_id,
}, .{});
} }
fn attachToTarget(cmd: anytype) !void { fn attachToTarget(cmd: anytype) !void {