Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions desktop/internal/pluginservice/hostworkspacewatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"os"
"path/filepath"
"runtime"
"slices"
"testing"
"time"
Expand Down Expand Up @@ -117,6 +118,11 @@ func TestWorkspaceWatchUsesNativeEventsAndReleasesOwnedSubscriptions(t *testing.
case "session":
service.resources.releaseSession(session.Session.ID)
case "root-replacement":
if runtime.GOOS == "windows" {
// ReadDirectoryChangesW keeps an open directory handle that blocks root replacement
// across parents or misses self-rename resync on Windows (1lck/Lithe-IDEA#2374).
t.Skip("ReadDirectoryChangesW keeps an open directory handle that blocks root replacement or misses self-rename resync on Windows (#2374)")
}
// Reusing the same path must not keep the old directory's stream alive.
if err := os.Rename(root, filepath.Join(t.TempDir(), "old-root")); err != nil {
t.Fatal(err)
Expand Down
7 changes: 4 additions & 3 deletions desktop/internal/workbench/remote_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,14 @@ func remoteRunDirectory(remoteRoot, directory string) (string, error) {
}

// writeScript writes a script saved as text where Core planned it, which must be a new file
// directly in the run's temporary folder. The host runs it through its interpreter, so it needs
// no execute permission.
// directly in the run's temporary folder. Passing start.scratch as the write boundary refuses
// descendant symlinks inside the temporary folder. The host runs it through its interpreter, so
// it needs no execute permission.
func (h remoteRunHost) writeScript(ctx context.Context, start remoteRunStart, script core.RunInlineScript) error {
if path.Dir(script.Path) != start.scratch {
return errors.New("inline script is outside its temporary folder")
}
_, saved, err := h.kernel.RemoteWriteFile(ctx, start.session.id, script.Path, []byte(script.Content), nil)
_, saved, err := h.kernel.RemoteWriteFile(ctx, start.session.id, script.Path, []byte(script.Content), nil, start.scratch)
if err != nil {
return h.failure(start.session.id, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
]
},
"owner": "Extensions",
"verification": "API-06–08:默认固定 Core 9ab2336(含 Core #190 与既有 #187 增量更新),运行 scripts/desktop/desktop-go.sh test ./internal/core ./internal/pluginservice ./internal/workbench -run 'TestWorkspace(Reads|Find|Search|Watch)|TestPluginWorkspace' -count=1 及对应 -race 检查,验证真实文件分页、文本/二进制读取、资源封装与权限上下文隔离、dirty 文档仍读磁盘及项目关闭取消,搜索分页/查询游标/范围与磁盘隔离,以及 macOS Viva 原生监听的递归创建、原子保存、删除、调用方归属、会话/上下文释放、在途通知取消、根目录替换后的最终重扫与释放。Windows 原生验收按用户要求本轮不执行,保持 pending。API-11:scripts/desktop/desktop-go.sh test ./internal/pluginservice -run 'TestFileChanges|TestChangeError' 与 ./internal/workbench -run 'TestPlugin(Save|Create|Rename|Trash)'。两平台原生验收使用内联合成插件:读取分页目录、磁盘文件,验证链接与 .. 越界拒绝、取消和重开工作区隔离,再保存/另存为、复制、重命名打开文件、移到废纸篓并恢复;无头测试不能替代 Windows reparse point 与目录共享行为验收。验收后关闭应用并确认无残留进程。",
"verification": "API-06–08:默认固定 Core 9ab2336(含 Core #190 与既有 #187 增量更新),运行 scripts/desktop/desktop-go.sh test ./internal/core ./internal/pluginservice ./internal/workbench -run 'TestWorkspace(Reads|Find|Search|Watch)|TestPluginWorkspace' -count=1 及对应 -race 检查,验证真实文件分页、文本/二进制读取、资源封装与权限上下文隔离、dirty 文档仍读磁盘及项目关闭取消,搜索分页/查询游标/范围与磁盘隔离,以及 macOS/Linux Viva 原生监听的递归创建、原子保存、删除、调用方归属、会话/上下文释放、在途通知取消、根目录替换后的最终重扫与释放;Windows 上 root-replacement 子用例因 ReadDirectoryChangesW 持有目录句柄阻塞跨父目录重命名及不投递自身重命名事件而跳过(跟踪于 #2374),dispose/context/session 释放子用例继续在 Windows 运行。Windows 原生验收按用户要求本轮不执行,保持 pending。API-11:scripts/desktop/desktop-go.sh test ./internal/pluginservice -run 'TestFileChanges|TestChangeError' 与 ./internal/workbench -run 'TestPlugin(Save|Create|Rename|Trash)'。两平台原生验收使用内联合成插件:读取分页目录、磁盘文件,验证链接与 .. 越界拒绝、取消和重开工作区隔离,再保存/另存为、复制、重命名打开文件、移到废纸篓并恢复;无头测试不能替代 Windows reparse point 与目录共享行为验收。验收后关闭应用并确认无残留进程。",
"notes": "Viva 已接通 documents/list|getSnapshot、editor/getActive|getSelections|open|reveal|insertText|replaceSelections|applyEdits、window/showInformation|showWarning|showError、browser/openExternal(仅 http/https URL)、documents/registerContentProvider、editor/registerProviders。编辑走编辑器自己的撤销栈,整批一步,按 view 修订号做版本隔离,只读/组字/过期版本被拒。editor/open 只落光标(范围起点)。API-11(documents.save、workspace.files.write)已接通:documents/save|saveAs|close 走文档自己的保存,磁盘冲突、硬链接、未命名文档、组字被拒并返回错误码,不弹窗;workspace/create(文件、文件夹、kind:\"symlink\" 的符号链接)|rename|copy|trash 的参数由 Core 严格检查,磁盘变更由 Core 内核命令 workspace.createEntry|renameEntry|copyEntry|resolveEntry 完成(不跟随最后一段、不覆盖),窗口只负责先保存其下文档、打开的文档跟随文件移动、本地历史、项目树和系统废纸篓;Windows 上建符号链接需要开发者模式或管理员,否则返回 failed。API-06(workspace.files.read)已接通本地工作区的 workspace/readDirectory|stat|readFile:路径、隐藏规则、有界分页、no-follow 和 128 KiB 磁盘读取预算均由 Core 执行,文本/base64 与截断前缀 identity 如实返回,不读取 dirty 文档;窗口关闭或替换会取消并拒绝旧结果,remote authority 明确拒绝。API-07/08 已接通 workspace/watch|findFiles|findText:Core 复用匹配、编码和隐藏/索引规则,以 no-follow 句柄搜索磁盘、处理分页游标与监听过滤;Viva 原生事件无空闲轮询,订阅按插件/会话/上下文释放,dispose 返回前停止通知;搜索每页和总结果最多 200,精确范围为 null。macOS 真实文件与原生事件测试已通过;Windows 本轮不验收。默认 Core 已固定到 9ab2336,包含本次 Core #190 改动并保留既有 #187 增量更新依赖。整体条目仍含其他未完成能力,状态保持 partial/pending。未接通:preview/openHTML(Viva 有系统 Web 视图,但编辑器区还没有嵌入网页的标签)、browser/openExternal 的 resource 形式(返回 unsupportedOption)。",
"legacy": {
"revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36",
Expand Down
Loading
Loading