You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** repo 解析:数字 id 或显示名(root_path 是本机私有路径,不作为对外键)。 */constbyName=db.prepare("SELECT * FROM choro_repos WHERE name = ?").get(String(ref));returnbyName??null;
Activity
strange2000 commentedon Nov 5, 2026
补充一个实测细节,说明为什么「按 name 指定 repo」也救不了双机场景:
lib/wiki/queries.js:26-37.get()在多行同名时只返回第一条,不报歧义(歧义分支只在 ref 为空时触发,见tools.js:102的repo-ambiguous)。而name来自仓库根package.json的name(t0.js:77),双系统上同一个仓库自然同名。于是双系统 + 共享 memory.db 的最坏路径是:
(id=2, name=dsh-orb-cordis, root_path=D:\...)(id=3, name=dsh-orb-cordis, root_path=/Users/...)choro_read_page传repo: "dsh-orb-cordis"→ 命中.get()返回的第一行(很可能是 id=2,即 Windows 那条)readPage用join("D:\\...", rel_path)拼路径 → 文件不存在 → 读页失败,且错误语义丢失(叠加 0.11.0 chorography:choro_* 三个工具的错误分支返回 schema 外字段,宿主判 invalid output(真实原因不可见) #579)所以 B 方案(各留本机副本)在双系统下实际要按数字 id 指定 repo,而 id 是自增的、每端不同、且会随清理变化——这比
root_path作键更难维护。如果暂时不做完整的
portable_key+choro_repo_paths拆分,一个成本很低的第一步是:在queries.js的 name 解析里显式检测多行同名并返回repo-ambiguous(列出 id + root_path + git_baseline),而不是静默取第一条。这样至少用户能选对 id。Merge origin/main into fix/581-choro-portable-identity
Merge pull request #679 from slow-stack/fix/581-choro-portable-identity