api: paths that are not valid UTF-8 come back changed in JSON
維護者通常 1 天內回覆
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- go, json
研究方向
The issue identifies Go's encoding/json behavior and says every endpoint that returns paths is affected, but it names no files or tests. Start by locating the API path fields and their JSON serialization, then review the open linked pull request #729 and its discussion. Done means agreeing on a wire format for non-UTF-8 paths, documenting it, and ensuring clients can round-trip the original path bytes.
由索引模型根據 Issue 內容生成。
描述
Problem
A tree entry name may hold bytes that are not valid UTF-8 (git accepts any byte except NUL and /). The API returns such a path changed: Go's encoding/json writes each invalid byte as U+FFFD, so a<0xff>b comes back as "a\ufffdb". A client cannot send that path back (for example in grep paths, file?path=, blame?path=), because it no longer names the file. This affects every endpoint that returns paths. Main has the same behavior.
The grep cursor is not affected: it base64-encodes the raw path bytes, so paging still works.
Found
By the clean-context advisor on PR #585 (#583, newline paths in grep), 2026-10-28. The advisor checked the encoding/json behavior. I did not call the API with such a path.
Possible fix
Decide on a wire form for non-UTF-8 paths (for example, an extra base64 field next to path, as some git hosting APIs do), and document it. This is an API design decision.
Trigger
A user report of a path that cannot be read back, or the next API change that adds a path field.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- 主要語言
- Go
- 星號
- 0
- 分支
- 0
- 平均合併
- 6 小時 16 分鐘
- 30 天內合併 PR
- 243
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
coder/openstorage 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
coder/openstorage#807 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 49/100
coder/openstorage#806 ·
維護者通常 1 天內回覆
-
api: merge/preview ignores strategy, squash and allow_unrelated_histories可能已有人在做 @ThomasK33 今天認領。 未關閉
難度 4/5 3-5 天 新手友好度 35/100
coder/openstorage#805 ·
維護者通常 1 天內回覆
-
githttp: +import remote serves clone and fetch, and its pushes stay out of the normal branch list可能已有人在做 @ThomasK33 今天認領。 未關閉
難度 5/5 一週以上 新手友好度 20/100
coder/openstorage#804 · 2 則留言 ·
維護者通常 1 天內回覆
-
api: branches/create ignores expected_target_sha, so a guarded create or move can overwrite a branch可能已有人在做 @ThomasK33 今天認領。 未關閉
難度 4/5 3-5 天 新手友好度 35/100
coder/openstorage#803 ·
維護者通常 1 天內回覆
查看 coder/openstorage 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
coder/coder-logstream-kube#255 · 1 則留言 ·
-
[FEATURE]: 录入 AIDEV Agent Package v1 接入参考文档可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉kind/features
難度 2/5 1-3 小時 新手友好度 73/100
TencentBlueKing/bk-nodemgr#3991 ·
維護者通常 1 天內回覆
-
meta
難度 2/5 1-3 小時 新手友好度 62/100
last9/last9-mcp-server#554 ·
維護者通常 1 天內回覆