Skip to content

Fix draft/update 47001: shape articles as single object - #16

Merged
leether merged 1 commit into
mainfrom
leether/draft-update-articles-shape-20260717
Jul 17, 2026
Merged

Fix draft/update 47001: shape articles as single object#16
leether merged 1 commit into
mainfrom
leether/draft-update-articles-shape-20260717

Conversation

@leether

@leether leether commented Jul 17, 2026

Copy link
Copy Markdown
Owner

问题

篇7 推送后修正作者字段时发现:create_wechat_draft.mjs --update 必挂,微信返回 47001 data format error。

根因(三重验证)

  1. 代码:update 分支复用 draft/add 的 payload(articles 为数组),仅追加 media_id/index
  2. 官方文档:draft/update 的 articles 类型是 object(单篇文章)
  3. 现场 A/B:relay 探针草稿,数组形状 → 47001 精确复现,对象形状 → ok

修复

  • 新增 applyDraftUpdateShape(数组 → 单对象),update 分支在浅拷贝上调用——下游证据簿记(push-result/audit)继续读数组形状(第一版补丁就地转换曾导致 articles[0] undefined,relay 现场验证抓到)
  • harness 新增 test-draft-update-shape.mjs:钉住对象形状 + 拷贝调用契约
  • CHANGELOG 记录

验证

  • npm run check 全绿(含新测试)
  • relay 端到端:探针草稿走补丁脚本 --updateoperation: draft/updatecompletion_status: verified,证据文件正常产出;探针已清理

The update branch reused the draft/add payload (articles as array);
draft/update requires a single article object and rejects the array
with errcode 47001 (data format error). Root cause triple-verified:
code read, official doc (articles: object), and a live A/B probe on
XINZHE (array -> 47001, object -> ok).

Add applyDraftUpdateShape and call it on a shallow copy at the update
branch so downstream evidence bookkeeping keeps the array shape.
Regression test pins both the object shape and the copy-at-call-site
contract. Live-verified end-to-end on the relay with a probe draft
(draft/update ok, completion_status: verified), probe cleaned up.
@leether
leether merged commit 844a9fa into main Jul 17, 2026
2 checks passed
@leether
leether deleted the leether/draft-update-articles-shape-20260717 branch July 17, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant