{"record":{"id":"7c2285f312f57faa","repo":"tonhowtf/omniget","slug":"no-cookies-in-payload-match-domain-root","errorCode":null,"errorMessage":"no cookies in payload match domain {root}","messagePattern":"no cookies in payload match domain (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/cookies/storage.rs","lineNumber":409,"sourceCode":"}\n\npub fn ingest_to_account(\n    domain: &str,\n    requested_slug: &str,\n    cookies: &[ExtensionCookie],\n    source: IngestSource,\n) -> anyhow::Result<(String, usize)> {\n    let root = root_domain_of(domain);\n    if root.is_empty() {\n        anyhow::bail!(\"invalid domain: {domain}\");\n    }\n    let scoped: Vec<ExtensionCookie> = cookies\n        .iter()\n        .filter(|c| root_domain_of(&c.domain) == root)\n        .cloned()\n        .collect();\n    if scoped.is_empty() {\n        anyhow::bail!(\"no cookies in payload match domain {root}\");\n    }\n\n    let mut registry = load_registry();\n    let bucket = registry.buckets.entry(root.clone()).or_insert_with(|| {\n        let platform = PlatformKind::from_domain(&root);\n        BucketEntry {\n            platform_kind: platform.as_str().to_string(),\n            accounts: Vec::new(),\n        }\n    });\n\n    let mut slug = if requested_slug.trim().is_empty() {\n        slugify_alias(source.alias_hint.as_deref().unwrap_or(\"\"))\n    } else {\n        slugify_alias(requested_slug)\n    };\n    if slug == DEFAULT_SLUG {\n        slug = format!(\"{}-extra\", DEFAULT_SLUG.trim_start_matches('_'));","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/cookies/storage.rs#L391-L427","documentation":"After computing the root domain, ingest_to_account() filters the incoming cookies to those whose own domain maps to the same root. If none match, it bails with 'no cookies in payload match domain {root}' rather than creating an empty bucket.","triggerScenarios":"Calling ingest_to_account(domain=\"bilibili.com\") with cookies whose c.domain belongs to a different root (e.g. '.example.com'), or with an empty cookie list.","commonSituations":"Copying cookies from the wrong site; mixing cookies for several domains in one payload; header-pair imports that omitted a Domain attribute and got scoped to an unexpected root.","solutions":["Ensure every cookie's domain shares the target root, e.g. cookies for '.bilibili.com' when ingesting to 'bilibili.com'.","Check that the import parser did not mangle cookie domains (empty or wrong Domain field).","Verify you exported cookies from the same site you're ingesting into."],"exampleFix":"// before\nlet cookies: Vec<ExtensionCookie> = all_cookies; // mixed domains\ningest_to_account(root, \"bilibili.com\", slug, &cookies, src)?;\n// after\nlet scoped: Vec<ExtensionCookie> = all_cookies.into_iter().filter(|c| c.domain.ends_with(\"bilibili.com\")).collect();\nanyhow::ensure!(!scoped.is_empty(), \"no bilibili cookies in payload\");\ningest_to_account(root, \"bilibili.com\", slug, &scoped, src)?;","handlingStrategy":"validation","validationCode":"let root = storage::root_domain_of(domain);\nanyhow::ensure!(cookies.iter().any(|c| storage::root_domain_of(&c.domain) == root), \"no cookies match {root}\");","typeGuard":null,"tryCatchPattern":"match ingest_to_account(root, domain, slug, &cookies, src) {\n    Err(e) if e.to_string().contains(\"no cookies in payload match\") => warn_wrong_site_export(),\n    other => other,\n}","preventionTips":["Export cookies from the same site you ingest into","Verify cookie Domain attributes weren't stripped by the parser","Log root domains of both sides when imports fail"],"tags":["cookies","domain","ingest","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}