{"record":{"id":"01f9f7b362733771","repo":"toeverything/AFFiNE","slug":"ech-config-required","errorCode":null,"errorMessage":"ech_config_required","messagePattern":"ech_config_required","errorType":"validation","errorClass":"napi::Error","httpStatus":null,"severity":"error","filePath":"packages/backend/native/src/safe_fetch.rs","lineNumber":251,"sourceCode":"    allow_private_target_origin: request.allow_private_target_origin,\n    ech_config_list: ech_config_list(request)?,\n  })\n}\n\nfn image_inspection_options(options: ImageInspectionOptions) -> safefetch::ImageInspectionOptions {\n  safefetch::ImageInspectionOptions {\n    max_width: options.max_width,\n    max_height: options.max_height,\n    max_pixels: options.max_pixels,\n  }\n}\n\nfn ech_config_list(request: &SafeFetchRequest) -> anyhow::Result<Option<Vec<u8>>> {\n  if !request.enable_ech.unwrap_or(false) {\n    return Ok(None);\n  }\n  let Some(config_list) = request.ech_config_list.as_ref() else {\n    anyhow::bail!(\"ech_config_required\");\n  };\n  Ok(Some(config_list.to_vec()))\n}\n\nfn invalid_arg(error: impl ToString) -> Error {\n  Error::new(Status::InvalidArg, error.to_string())\n}\n","sourceCodeStart":233,"sourceCodeEnd":259,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/backend/native/src/safe_fetch.rs#L233-L259","documentation":"ech_config_list guard: the request set enable_ech=true but supplied no ech_config_list bytes; ECH cannot be negotiated without the config, so the request is rejected with the sentinel error 'ech_config_required'.","triggerScenarios":"Raised in ech_config_list when a SafeFetch request sets enable_ech to true but does not provide ech_config_list.","commonSituations":"ECH was requested without supplying the ECH config list. Provide ech_config_list bytes with the request or disable enable_ech.","solutions":["Provide the required ECH configuration for the fetch.","Disable ECH if the deployment does not support it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}