{"record":{"id":"54199b7ac1dce996","repo":"siyuan-note/siyuan","slug":"invalid-display-name","errorCode":null,"errorMessage":"invalid display name","messagePattern":"invalid display name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":684,"sourceCode":"\t\tinfo, lstatErr := os.Lstat(current)\n\t\tif lstatErr != nil {\n\t\t\treturn lstatErr\n\t\t}\n\t\tif info.Mode()&os.ModeSymlink != 0 {\n\t\t\treturn ErrBootAppearanceAssetForbidden\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateBootAppearanceDisplayName(displayName map[string]string) error {\n\tif strings.TrimSpace(displayName[\"default\"]) == \"\" {\n\t\treturn errors.New(\"displayName.default is required\")\n\t}\n\tfor lang, value := range displayName {\n\t\tif strings.TrimSpace(lang) == \"\" || strings.TrimSpace(value) == \"\" || len(lang) > 32 || len(value) > 128 ||\n\t\t\tstrings.ContainsAny(value, \"\\x00\\r\\n\") {\n\t\t\treturn errors.New(\"invalid display name\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc normalizeBootAppearanceFrontends(manifestFrontends, pluginFrontends []string) ([]string, error) {\n\tcandidates := manifestFrontends\n\tif len(candidates) == 0 {\n\t\tcandidates = pluginFrontends\n\t}\n\tfrontends := []string{}\n\tseen := map[string]bool{}\n\tfor _, frontend := range candidates {\n\t\tif frontend == \"all\" && len(manifestFrontends) == 0 {\n\t\t\tfor _, normalized := range []string{\"desktop\", \"mobile\"} {\n\t\t\t\tif !seen[normalized] {\n\t\t\t\t\tseen[normalized] = true\n\t\t\t\t\tfrontends = append(frontends, normalized)","sourceCodeStart":666,"sourceCodeEnd":702,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/boot_appearance.go#L666-L702","documentation":"After ensuring a default exists, validateBootAppearanceDisplayName iterates every entry of the displayName map. A language key must be non-blank and at most 32 bytes, and each value must be non-blank, at most 128 bytes, and free of NUL/CR/LF characters. Any violation yields this generic \"invalid display name\" error.","triggerScenarios":"Loading a package whose displayName map contains: an empty-string language key; a value that is empty/whitespace; a language tag longer than 32 bytes; a name longer than 128 bytes; or a value containing \\x00, \\r, or \\n.","commonSituations":"Pasting a multi-line title from a document into a manifest value; an oversized translated name; BCP-47 tags with long private-use subtags exceeding 32 bytes; editors inserting newlines into JSON string values.","solutions":["Locate the offending entry in the manifest's displayName map and give both the language key and value non-blank, trimmed content","Shorten names to at most 128 bytes and language tags to at most 32 bytes","Strip newlines, carriage returns, and control characters from all display names"],"exampleFix":"// before\n\"displayName\": {\"default\": \"Line one\\nLine two\"}\n// after\n\"displayName\": {\"default\": \"Line one Line two\"}","handlingStrategy":"validation","validationCode":"function validDisplayNameMap(m) {\n  return Object.entries(m ?? {}).every(([lang, v]) =>\n    lang.trim() !== \"\" && String(v).trim() !== \"\" && lang.length <= 32 &&\n    v.length <= 128 && !/[\\x00\\r\\n]/.test(v));\n}","typeGuard":"function isCleanString(s) {\n  return typeof s === \"string\" && s.trim() !== \"\" && s.length <= 128 && !/[\\x00\\r\\n]/.test(s);\n}","tryCatchPattern":"try {\n  await loadManifest(pkgPath);\n} catch (e) {\n  if (String(e).includes(\"invalid display name\")) {\n    // scan all displayName entries for blanks, oversize, or control chars\n  }\n}","preventionTips":["Trim whitespace from names and language keys","Keep display names at most 128 bytes","Strip newlines/control characters when copying names from documents","Keep language tags short (<= 32 bytes)"],"tags":["boot-appearance","manifest","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}