[Bug] Lithe 操作运行期间另一个程序写入的文本,本地历史有时记成用户(TestLocalHistoryTellsAnOperationsWriteFromAnotherPrograms 约 1/4 失败)
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Start with desktop/internal/workbench/local_history_host_write_test.go, especially the failing assertion around line 84, and trace how deferred host writes are attributed during an operation. Run the reported desktop-go.sh test ./internal/workbench -run 'TestLocalHistoryTellsAnOperationsWriteFromAnotherPrograms$' -count=12 command to reproduce the intermittent failure. Done means the test reliably attributes other to an external program and lithe to the user; an open pull request is already linked.
索引モデルが issue の本文から書いたものです。
説明
Platform / 平台
macOS
Area / 模块
Editor / 编辑器
Lithe version / Lithe 版本
源码构建,main d96af8e93(含 #2635)
Priority / 优先级
P2 / 后续考虑:目前不着急,可安排到后续版本
OS and architecture / 操作系统与架构
macOS 27.3,arm64
Environment / 环境信息
- Go:go1.27.4 darwin/arm64,经
scripts/desktop/desktop-go.sh运行。 - Core:
scripts/desktop/build-desktop-core.sh固定的 Core 提交(2f236ab8 与 362cb813 上都出现)。 - 只在单元测试里观察到,没有在运行中的应用里复现。Windows 没有跑过。
Steps to reproduce / 复现步骤
- 在 main 上运行:
./scripts/desktop/desktop-go.sh test ./internal/workbench -run 'TestLocalHistoryTellsAnOperationsWriteFromAnotherPrograms$' -count=12 - 统计失败次数。
2026-12-03 本机两次采样:12 次中失败 3 次;另一次 15 次中失败 4 次。全量 desktop-go.sh test ./... 里也会随机失败。
Expected behavior / 预期行为
测试稳定通过:Lithe 的操作运行期间,另一个程序写入的文本(other)在本地历史里记为“外部程序”,操作自己写入的文本(lithe)记为“用户”。
Actual behavior / 实际行为
约四分之一的运行失败在 desktop/internal/workbench/local_history_host_write_test.go:84:
the other program's text was caused by &{Kind:user ID:}, want an external program
也就是另一个程序写入的 other 有时被记成了用户。测试在 #2635(Git/删除前快照、磁盘修改前文本与文件夹本地历史)引入。
待确认的推测:操作运行时被推迟的那次重新加载(hostWrites.deferred),和操作结束后自己的写入,在时序上有时被一起处理,other 的快照于是在操作结束后才记录、沿用了操作的“用户”身份。如果是这样,这不只是测试问题:真实使用中,Lithe 操作期间别的程序改的内容在本地历史里也可能被记成用户。需要先确认是产品的归属判断有竞态,还是测试的等待条件不够。
Logs or diagnostic output / 日志或诊断输出
local_history_host_write_test.go:84: the other program's text was caused by &{Kind:user ID:}, want an external program
--- FAIL: TestLocalHistoryTellsAnOperationsWriteFromAnotherPrograms (0.04s)
Screenshots or recordings / 截图或录屏
不适用:单元测试失败,没有界面。
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
- I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 151
- 平均マージ
- 3時間 13分
- マージ済み PR(30日)
- 614
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
1lck/Lithe-IDEA のほかの issue
-
enhancement issue-form:feature review: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
1lck/Lithe-IDEA#2678 ·
メンテナーはふだん 1 日以内に返信
-
refactor review: high
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
1lck/Lithe-IDEA#2565 ·
メンテナーはふだん 1 日以内に返信
-
area:ui enhancement P2 platform:cross-platform refactor review: high
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
1lck/Lithe-IDEA#2365 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement issue-form:feature review: low
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
1lck/Lithe-IDEA#2677 ·
メンテナーはふだん 1 日以内に返信
-
area:ai enhancement P2 review: high
難易度 5/5 1週間以上 初心者へのやさしさ 39/100
1lck/Lithe-IDEA#2660 ·
メンテナーはふだん 1 日以内に返信
1lck/Lithe-IDEA の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Techiebutler/freeframe#687 ·
メンテナーはふだん 1 日以内に返信
-
enhancement from-app needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
nightly-labs/openbot#23050 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OHDSI/Data2Evidence#3846 ·
メンテナーはふだん 3 日以内に返信
-
frontend: EditorDialog: Save & Apply on an empty or comment-only document reports success and applies nothing対応中かも @shubhamrai9122-creator が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
kubernetes-sigs/headlamp#9086 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openai/openai-node#3232 ·
メンテナーはふだん 1 日以内に返信