mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-24 09:18:27 +00:00
This follow-up tightens the new multi-file remote stat RPC behavior to
match expected usage: duplicate input paths are skipped, per-path stat
failures no longer fail the entire call, and cancellation is respected
during iteration.
- **RPC response model**
- Added `staterror` to `FileInfo`:
- `StatError string \`json:"staterror,omitempty"\``
- Generated TS type now exposes `staterror?: string` on `FileInfo`.
- **`RemoteFileMultiInfoCommand` behavior updates**
- **Dedup:** if an input path key is already present in the result map,
the loop continues.
- **Non-fatal stat failures:** on `fileInfoInternal` error, the command
now emits a `FileInfo` entry for that input with:
- resolved `path`, `dir`, `name`
- `staterror` populated with `err.Error()`
- continues processing remaining paths.
- **Cancellation:** checks `ctx.Err()` at the top of each iteration and
returns immediately if canceled.
- **PR scope cleanup**
- Removed the previously added test file from this PR per request.
```go
if _, found := rtn[path]; found {
continue
}
if ctx.Err() != nil {
return nil, ctx.Err()
}
fileInfo, err := impl.fileInfoInternal(cleanedPath, false)
if err != nil {
rtn[path] = wshrpc.FileInfo{
Path: wavebase.ReplaceHomeDir(cleanedPath),
Dir: computeDirPart(cleanedPath),
Name: filepath.Base(cleanedPath),
StatError: err.Error(),
}
continue
}
```
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| sysinfo.go | ||
| wshremote.go | ||
| wshremote_file.go | ||
| wshremote_job.go | ||