fix(label): paginate label lookup in +update to avoid clobbering fields #363

Merged
wbtiger merged 1 commits from heke1228/gitlink-cli:fix/label-update-pagination into master 2026-07-14 20:43:30 +08:00
Contributor

背景

label +updatefetchLabelGET 标签列表的第一页(其注释却称“分页匹配 id”)。当目标标签不在第一页时返回未命中,runUpdate 回退到空 description 与默认色 #1E90FF,随后的 PATCH 覆盖服务端真实值——静默数据丢失

改动

  • fetchLabel 真正分页,直到命中或列表耗尽。
  • 仅当用户显式传入字段时才用其值;未指定字段不再被静默重置。
  • 彻底找不到时返回清晰错误,而非用默认值 PATCH
  • 补测试:目标标签在第二页时 description/color 被保留。

验证

go build ./...go test ./shortcuts/label/ 通过。

## 背景 `label +update` 的 `fetchLabel` 只 `GET` 标签列表的**第一页**(其注释却称“分页匹配 id”)。当目标标签不在第一页时返回未命中,`runUpdate` 回退到空 `description` 与默认色 `#1E90FF`,随后的 `PATCH` 覆盖服务端真实值——**静默数据丢失**。 ## 改动 - `fetchLabel` 真正分页,直到命中或列表耗尽。 - 仅当用户显式传入字段时才用其值;未指定字段不再被静默重置。 - 彻底找不到时返回清晰错误,而非用默认值 `PATCH`。 - 补测试:目标标签在第二页时 `description`/`color` 被保留。 ## 验证 `go build ./...`、`go test ./shortcuts/label/` 通过。
heke1228 added 1 commit 2026-07-08 12:16:51 +08:00
6ae52f40f7
fix(label): paginate label lookup in +update to avoid clobbering fields
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
wbtiger merged commit 2d8ff0d227 into master 2026-07-14 20:43:30 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#363
No description provided.