{"record":{"id":"a19def4330b88693","repo":"siyuan-note/siyuan","slug":"377-conf-language","errorCode":"377","errorMessage":"Conf.Language(377)","messagePattern":"Conf\\.Language\\(377\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/asset_download.go","lineNumber":77,"sourceCode":"\t\t\tidentity = append(identity, filepath.Clean(c.Local.Endpoint))\n\t\t}\n\t}\n\tdata, _ := json.Marshal(identity)\n\treturn fmt.Sprintf(\"%x\", sha256.Sum256(data))\n}\n\n// DeferredSyncAssets 仅读取逻辑清单，不发起下载。\nfunc DeferredSyncAssets() ([]*entity.File, error) {\n\treturn deferredSyncAssets()\n}\n\nfunc deferredSyncAssets() ([]*entity.File, error) {\n\texists, err := assetDownloadStateExists()\n\tif err != nil || !exists {\n\t\treturn nil, err\n\t}\n\tif Conf.Repo == nil || len(Conf.Repo.Key) == 0 {\n\t\treturn nil, errors.New(Conf.Language(377))\n\t}\n\treturn dejavu.ReadDeferredAssets(assetDownloadStatePath(), Conf.Repo.Key)\n}\n\n// validateAssetDownloadSourceScope 在公布新的账号身份前保留未完成的资源与历史恢复来源。\nfunc validateAssetDownloadSourceScope(scope string) error {\n\texists, err := assetDownloadStateExists()\n\tif err != nil || !exists {\n\t\treturn err\n\t}\n\tif Conf.Repo == nil || len(Conf.Repo.Key) == 0 {\n\t\treturn errors.New(Conf.Language(377))\n\t}\n\tstored, err := dejavu.ReadAssetDownloadScope(assetDownloadStatePath(), Conf.Repo.Key)\n\tif err != nil || stored == scope {\n\t\treturn err\n\t}\n\treturn requireCompleteAssetDownloads()","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/asset_download.go#L59-L95","documentation":"deferredSyncAssets reads the persisted asset-download state to re-list pending asset files, but requires the data repo encryption key (Conf.Repo.Key) to decrypt that state. When no repo key exists, it fails with i18n message 377: the user must switch to 'Download all' before changing or resetting the data repository. The wrapped operation (and any deferred asset completion) is aborted.","triggerScenarios":"EnsureAssetLocal, EnsureAssetPrefixLocal, DeferredSyncAssets, ensureAllSyncAssets, or requireCompleteAssetDownloads runs while a partial asset-download state exists but Conf.Repo is nil or Conf.Repo.Key is empty (repo not opened / key reset).","commonSituations":"User reset or re-created the data repository while 'Download only modified assets now' mode was active; workspace moved to a machine without the repo key; cloud credential loss cleared the repo key.","solutions":["Switch sync asset download mode to 'Download all' to clear the pending asset-download state, then re-run the operation","Re-open/unlock the data repository so Conf.Repo.Key is populated before syncing assets","Complete or cancel the pending asset download before changing or resetting the repository","If the state is stale and unrecoverable, remove the asset download state file after backing up the workspace"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check repo key presence and pending asset-download state before asset operations\nconst sync = await fetchPost(\"/api/sync/getSyncInfo\", {});\nif (!sync.key || sync.assetDownloadStateExists) {\n  await fetchPost(\"/api/sync/setSyncAssetDownloadMode\", {mode: \"download-all\"});\n}","typeGuard":null,"tryCatchPattern":"try {\n  await ensureAssetLocal(path);\n} catch (e) {\n  if (String(e).includes(Conf.Language(377))) {\n    // prompt user to switch to 'Download all' or re-open the data repo\n  }\n}","preventionTips":["Finish or cancel pending asset downloads before resetting or re-creating the data repository","Keep the repo key available (unlock the repository) before running asset sync","Avoid moving workspaces between machines without repo key material","Switch to 'Download all' when you plan to change accounts or reset the repo"],"tags":["sync","assets","repo-key","i18n"],"backgroundTag":"missing-credentials","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"}