Fix draft/update 47001: shape articles as single object - #16
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
篇7 推送后修正作者字段时发现:
create_wechat_draft.mjs --update必挂,微信返回 47001 data format error。根因(三重验证)
articles为数组),仅追加 media_id/indexarticles类型是 object(单篇文章)修复
applyDraftUpdateShape(数组 → 单对象),update 分支在浅拷贝上调用——下游证据簿记(push-result/audit)继续读数组形状(第一版补丁就地转换曾导致articles[0]undefined,relay 现场验证抓到)test-draft-update-shape.mjs:钉住对象形状 + 拷贝调用契约验证
npm run check全绿(含新测试)--update,operation: draft/update、completion_status: verified,证据文件正常产出;探针已清理