{"record":{"id":"c166b1aa07fa6d37","repo":"sxyazi/yazi","slug":"failed-to-join-new-name-with-cwd","errorCode":null,"errorMessage":"Failed to join new name with CWD","messagePattern":"Failed to join new name with CWD","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"yazi-actor/src/mgr/create.rs","lineNumber":43,"sourceCode":"\t\tlet cwd = cx.cwd().to_owned();\n\n\t\tlet mut target: Pin<Box<dyn Stream<Item = StrandBuf> + Send>> = if target.is_empty() {\n\t\t\tlet input = input!(cx, YAZI.input.create(dir))?;\n\t\t\tBox::pin(\n\t\t\t\tUnboundedReceiverStream::new(input).filter_map(|event| async { event.map(Into::into) }),\n\t\t\t)\n\t\t} else {\n\t\t\tBox::pin(tokio_stream::iter(vec![target]))\n\t\t};\n\n\t\ttokio::spawn(async move {\n\t\t\tlet Some(name) = target.next().await else { return Ok(()) };\n\t\t\tif name.is_empty() {\n\t\t\t\treturn Ok(());\n\t\t\t}\n\n\t\t\tlet Ok(new) = cwd.try_join(&name) else {\n\t\t\t\tbail!(\"Failed to join new name with CWD\");\n\t\t\t};\n\n\t\t\tif !force\n\t\t\t\t&& let Some(file) = File::maybe_new(&new).await?\n\t\t\t\t&& !ConfirmProxy::show(ConfirmCfg::overwrite(&file)).await\n\t\t\t{\n\t\t\t\treturn Ok(());\n\t\t\t}\n\n\t\t\tlet end_sep = AnyAsciiChar::SEP.predicate(*name.encoded_bytes().last().unwrap());\n\t\t\tSelf::r#do(new, dir || end_sep).await\n\t\t});\n\t\tsucc!();\n\t}\n}\n\nimpl Create {\n\tasync fn r#do(new: UrlBuf, dir: bool) -> Result<()> {","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/sxyazi/yazi/blob/441b332de8b8800e70784cfbfb75369ab51ed9dd/yazi-actor/src/mgr/create.rs#L25-L61","documentation":"Thrown by Payload::from_str (yazi-dds/src/payload.rs:70) while parsing the inter-process DDS message wire format `kind,receiver,sender,body` (splitn on 4 comma-separated parts). The fourth part — the serialized Ember body — is missing, i.e. the string has fewer than four segments. Earlier segments missing would yield `empty kind`/`invalid receiver`/`invalid sender` instead; this error specifically means the first three parsed but the body is absent.","triggerScenarios":"A line read from the DDS stdout stream (yazi-to-yazi communication) containing only `kind,receiver,sender` or a trailing comma with nothing after it; hand-crafted `ya pub`-style messages or test harnesses writing malformed frames; truncation of a message in a pipe; a body containing raw commas is fine (splitn(4)) but an empty body is not.","commonSituations":"Custom external tools publishing to the DDS topic stream with a wrong frame layout; version mismatch between yazi instances exchanging events when an Ember kind stopped carrying a body; shell scripts echoing partial frames into the message bus.","solutions":["Emit the full four-part frame: `kind,receiver,sender,json-body` — ensure the JSON body is present even if it is `{}`","If publishing from a script/tool, reuse yazi's Display format rather than hand-building the string","Check for truncation: bodies are single-line JSON; a newline split will produce a head-only line on the next read","Align yazi versions on both ends of the DDS stream so kinds and bodies match"],"exampleFix":"# before\necho 'hi,0,1234' | yazi  # missing body part\n# after\necho 'hi,0,1234,{}' | yazi","handlingStrategy":"validation","validationCode":"// Rust: validate frame shape before parsing\nlet n = line.match_indices(',').count();\nif n < 3 { /* log and skip malformed frame */ }","typeGuard":"// Rust\nfn is_valid_frame(s: &str) -> bool { s.splitn(4, ',').count() == 4 }","tryCatchPattern":"// Rust\nmatch s.parse::<Payload>() {\n    Ok(p) => handle(p),\n    Err(e) => tracing::warn!(\"dropping malformed DDS frame: {e:#}\"),\n}","preventionTips":["Generate frames with the same Display format yazi uses, never by hand","Bodies must be single-line JSON on one physical line","Version-match yazi instances sharing a DDS stream","Validate external input at the read boundary and drop bad frames with a log"],"tags":["rust","dds","wire-format","parsing","yazi"],"backgroundTag":"message-parse-failed","analyzedSha":"441b332de8b8800e70784cfbfb75369ab51ed9dd","analyzedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}