hackmdio / hackmdio/hackmd-cli
Updating notes does not update all lines
- 主要語言
- TypeScript
- 星號
- 176
- 分支
- 13
- 平均合併
- 1 天 4 小時
- 30 天內合併 PR
- 5
描述
First of all, thanks for maintaining this tool.
Sometimes, when using the `notes update` command, the note is not fully updated. Here is a fairly small example/reproduction:
````sh
$ hackmd-cli notes create --content='
aa
```
aab
```
aab'
ID Title User path Team path
────────────────────── ──────── ───────── ─────────
59bbDYGPSESuaJuBh_fD4A Untitled gitmd
````
to create a note with some content. Now, update it with some other content:
````
$ hackmd-cli notes update --noteId 59bbDYGPSESuaJuBh_fD4A --content='
aa
```json
aabc
```
aabc'
````
However, the last modification (the last line) is not taken into account:
````
$ hackmd-cli export --noteId 59bbDYGPSESuaJuBh_fD4A
aa
```json
aabc
```
aab
````
If I do the `hackmd-cli notes update` command again, the content of the note matches what is required.
However, I've seen some old content/new content pairs where `hackmd-cli notes update` does nothing...
This seems to be a hackmd API bug (rather than the CLI), as I tried to directly write the HTTP requests, and it fails. But I could not find any github repository where we can file issues on the API itself. Feel free to redirect me if I'm not opening the issue in the right repo!
(while writing the HTTP requests by hand, I've also seen a case where writing a newline at the end of the JSON payload would change the outcome of the "update" API request... if that helps to track the bug)
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
首先,使用本報告中的內容對,透過 `hackmd-cli notes create`、`hackmd-cli notes update` 和 `hackmd-cli export` 指令重現此問題。比較更新一次和兩次後的匯出筆記,並判斷 CLI 是否能夠處理不一致的 HackMD API 回應;當最後一行能可靠地更新時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- typescript
- 領域
- api, cli
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100