{"record":{"id":"deeaaab65eb6f06d","repo":"sxyazi/yazi","slug":"hub-url-parent-depth-does-not-match-its-path","errorCode":null,"errorMessage":"Hub URL parent depth does not match its path","messagePattern":"Hub URL parent depth does not match its path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"yazi-shared/src/url/cow.rs","lineNumber":216,"sourceCode":"\twhere\n\t\tD: Deserializer<'de>,\n\t{\n\t\tUrlBuf::deserialize(deserializer).map(UrlCow::from)\n\t}\n}\n\nfn validate_auth_path(auth: &AuthArc, path: PathDyn) -> Result<()> {\n\tauth.validate()?;\n\tensure!(auth.path_kind()? == path.kind(), \"URL path kind does not match Auth kind\");\n\n\tif auth.kind.is_hub() {\n\t\tensure!(\n\t\t\tauth.parent_depth() == path.components().auth_depth(),\n\t\t\t\"Hub URL parent depth does not match its path\"\n\t\t);\n\t}\n\tOk(())\n}\n\n#[cfg(test)]\nmod tests {\n\tuse super::*;\n\tuse crate::url::UrlLike;\n\n\t#[test]\n\tfn test_parse() -> Result<()> {\n\t\tcrate::init_tests();\n\n\t\tstruct Case {\n\t\t\turl:   &'static str,\n\t\t\turn:   &'static str,\n\t\t\turi:   &'static str,\n\t\t\ttrail: &'static str,\n\t\t\tbase:  &'static str,\n\t\t}\n","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/sxyazi/yazi/blob/8ebf930f1796ae2076b7d6b0c5e93a1002c18134/yazi-shared/src/url/cow.rs#L198-L234","documentation":"Error \"Hub URL parent depth does not match its path\" thrown in sxyazi/yazi.","triggerScenarios":"Thrown at yazi-shared/src/url/cow.rs:244 when the library encounters an invalid state.","commonSituations":"Resolving `..` segments in a hub URL so that the number of parent traversals exceeds the path's actual depth.","solutions":["Fix the hub URL construction so the parent count matches the path segments; this is internal, so report with the URL that triggered it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8ebf930f1796ae2076b7d6b0c5e93a1002c18134","analyzedAt":"2026-08-19T05:27:26.468Z","contentChangedAt":"2026-08-19T05:27:26.468Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}