From cff003c333a3619975ad73374d5dbcc634d50dc9 Mon Sep 17 00:00:00 2001 From: leeguooooo Date: Wed, 10 Jun 2026 00:07:58 +0900 Subject: [PATCH] fix(connect): tolerate minimal targetInfo (relay re-announce omits title/url) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the connect fix, extension connect reached the relay but Target.getTargets failed: 'missing field title'. The ab-connect relay builds targets from the extension's synthesized Target.attachedToTarget; the re-announce path (reannounceAttachedTabs) emits a minimal targetInfo {targetId,type,attached} with no title/url, so strict deserialize of TargetInfo blew up the whole getTargets response. Make TargetInfo.title/url #[serde(default)] (empty) — tolerant of minimal CDP targetInfo from the relay (and the occasional real-CDP omission). Titles re-populate from Target.targetInfoChanged / page events after attach. --- cli/src/native/cdp/types.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/src/native/cdp/types.rs b/cli/src/native/cdp/types.rs index 1a2546a..81992a1 100644 --- a/cli/src/native/cdp/types.rs +++ b/cli/src/native/cdp/types.rs @@ -106,7 +106,13 @@ pub struct TargetInfo { pub target_id: String, #[serde(rename = "type")] pub target_type: String, + // Tolerate minimal targetInfo: the ab-connect relay's synthesized + // Target.attachedToTarget (re-announce path) omits title/url, and real CDP + // occasionally omits them too. Default to empty rather than fail the whole + // Target.getTargets deserialize. + #[serde(default)] pub title: String, + #[serde(default)] pub url: String, pub attached: Option, pub browser_context_id: Option,