{"record":{"id":"a201e1395b82154d","repo":"sxyazi/yazi","slug":"expected-custom-payload-of-kind-reply-kind","errorCode":null,"errorMessage":"Expected custom payload of kind `{reply_kind}`","messagePattern":"Expected custom payload of kind `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-cli/src/dds/exec.rs","lineNumber":63,"sourceCode":"\t\t\tPayload::new(EmberHi::borrowed([reply_kind])),\n\t\t)?;\n\n\t\tlet (mut lines, mut writer) = Stream::connect().await?;\n\t\twriter.write_all(payload.as_bytes()).await?;\n\t\twriter.flush().await?;\n\t\tdrop(writer);\n\n\t\twhile let Ok(Some(line)) = lines.next_line().await {\n\t\t\tmatch line.split(',').next() {\n\t\t\t\tSome(\"hey\") => {\n\t\t\t\t\tif let Ok(Ember::Hey(hey)) = Payload::from_str(&line).map(|p| p.body) {\n\t\t\t\t\t\tSelf::ensure_version(Some(&hey.version))?;\n\t\t\t\t\t\tSelf::ensure_ability(&hey.peers, kind, receiver)?;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSome(kind) if kind == reply_kind => match Payload::from_str(&line)?.body {\n\t\t\t\t\tEmber::Custom(body) => return Ok(body.data),\n\t\t\t\t\t_ => bail!(\"Expected custom payload of kind `{reply_kind}`\"),\n\t\t\t\t},\n\t\t\t\t_ => {}\n\t\t\t}\n\t\t}\n\n\t\tbail!(\"Connection closed before receiving reply\")\n\t}\n}\n","sourceCodeStart":45,"sourceCodeEnd":72,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-cli/src/dds/exec.rs#L45-L72","documentation":"In `Dds::ask`, the client streams reply lines until it sees one whose kind matches the expected `reply_kind`; if such a line arrives but its payload is not an `Ember::Custom` body, it bails with `Expected custom payload of kind \\`{reply_kind}\\``. The reply envelope matched but the payload shape did not.","triggerScenarios":"A reply with the expected kind arrives whose `Payload::from_str(...).body` is not `Ember::Custom` — e.g. a version/schema mismatch where the peer answers with a different Ember variant, or a proxy/mixed peer set answering with a non-custom payload of the same kind.","commonSituations":"`ya` and `yazi` versions diverging after an upgrade so the custom-reply encoding changed; another peer on the shared socket answering with an unexpected body type.","solutions":["Restart all `yazi` and `ya` processes after upgrading either binary so both speak the same payload schema.","Ensure only one compatible Yazi instance/peer set is reachable on the DDS connection.","Check `Self::ensure_version` / peer ability output in debug logs to identify the mismatched peer."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match Dds::ask(...).await {\n  Err(e) if e.to_string().starts_with(\"Expected custom payload\") => {\n    eprintln!(\"peer payload schema mismatch — restart all yazi/ya processes\");\n  }\n  other => other,\n}","preventionTips":["Restart every yazi and ya process after upgrading either binary.","Avoid mixing peers from different versions on the same DDS connection.","Rely on ensure_version/ensure_ability checks firing before the payload stage to catch mismatches early."],"tags":["ipc","dds","protocol","schema-mismatch"],"backgroundTag":"schema-validation-failed","analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}