{"record":{"id":"5214c9094dbbe4ba","repo":"sxyazi/yazi","slug":"invalid-receiver","errorCode":null,"errorMessage":"invalid receiver","messagePattern":"invalid receiver","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"yazi-dds/src/payload.rs","lineNumber":65,"sourceCode":"\t}\n}\n\nimpl Payload<'static> {\n\tpub(super) fn emit(self) {\n\t\temit!(Call(relay!(app:accept_payload).with_any(\"payload\", self)));\n\t}\n}\n\nimpl FromStr for Payload<'static> {\n\ttype Err = anyhow::Error;\n\n\tfn from_str(s: &str) -> Result<Self, Self::Err> {\n\t\tlet mut parts = s.splitn(4, ',');\n\n\t\tlet kind = parts.next().ok_or_else(|| anyhow!(\"empty kind\"))?;\n\n\t\tlet receiver =\n\t\t\tparts.next().and_then(|s| s.parse().ok()).ok_or_else(|| anyhow!(\"invalid receiver\"))?;\n\n\t\tlet sender =\n\t\t\tparts.next().and_then(|s| s.parse().ok()).ok_or_else(|| anyhow!(\"invalid sender\"))?;\n\n\t\tlet body = parts.next().ok_or_else(|| anyhow!(\"empty body\"))?;\n\n\t\tOk(Self { receiver, sender, body: Ember::from_str(kind, body)? })\n\t}\n}\n\nimpl<'a> From<Ember<'a>> for Payload<'a> {\n\tfn from(value: Ember<'a>) -> Self { Self::new(value) }\n}\n\nimpl TryFrom<ActionCow> for Payload<'_> {\n\ttype Error = anyhow::Error;\n\n\tfn try_from(mut a: ActionCow) -> Result<Self, Self::Error> {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/sxyazi/yazi/blob/94abcfa92f4ad3f0a1aef6c1ea083cfb8aa6c8c2/yazi-dds/src/payload.rs#L47-L83","documentation":"The second comma-separated field of a DDS payload line is the receiver id, parsed with Id::from_str (a u64). \"invalid receiver\" means that field is absent or does not parse as a decimal unsigned 64-bit integer. Receiver 0 broadcasts to all peers.","triggerScenarios":"Lines like `hover,me,123,{...}` (non-numeric receiver), `hover,0x10,...` (hex not accepted), ids wrapped in quotes or whitespace, or a line truncated before the second field so parts.next() yields nothing parseable.","commonSituations":"Hand-crafted pubsub messages from scripts; tools emitting ids in hex or with padding; format drift between writer and reader of the DDS stream.","solutions":["Write the receiver as a plain decimal u64; use 0 to broadcast","Strip quotes/whitespace around the id before formatting the line","Template new lines on real Payload::to_string() output"],"exampleFix":"// before\nPayload::from_str(\"hover,peer-1,42,{}\")?;\n\n// after (0 = broadcast to all peers)\nPayload::from_str(\"hover,0,42,{}\")?;","handlingStrategy":"validation","validationCode":"// Check field 2 parses as u64 before from_str:\nlet f2 = line.splitn(4, ',').nth(1);\nensure!(f2.is_some_and(|s| s.parse::<u64>().is_ok()), \"invalid receiver\");","typeGuard":"fn valid_receiver(s: &str) -> bool { s.parse::<u64>().is_ok() }","tryCatchPattern":null,"preventionTips":["Emit the receiver as a plain decimal u64 (0 = broadcast)","No hex, quotes, or whitespace around ids","Template messages on real ya pub output"],"tags":["dds","pubsub","parsing","validation"],"backgroundTag":null,"analyzedSha":"94abcfa92f4ad3f0a1aef6c1ea083cfb8aa6c8c2","analyzedAt":"2026-08-16T09:56:24.836Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}