Repository navigation
fix: plan replacement publications with the real staged media type - #348
Merged
Merged
Conversation
A refetch replacement stages its media with the real Telegram type (e.g. animation) while the chain's media_asset_refs may still describe the superseded work as kind=image. plan_review_media hard-coded every non-document entry to photo, so publishing sent an animation file_id via sendPhoto — a certain Telegram BadRequest. On 2.84.2 that reject was then misclassified as a lost response (BadRequest subclasses NetworkError), which triggered the unrelated-forward rollback that broke review 208 publication. The indexed local item is already documented as authoritative for presentation; this makes the code honor its explicit type for animation/video/audio too. Asset-only entries keep the photo default.
A refetch replacement whose submission carries no asset manifest leaves the SUPERSEDED work's media_asset_refs on the chain. Beside the type downgrade fixed in the previous commit, those stale refs also entered the plan as asset-only remote entries — publishing would have shipped the old work's pages together with the new work's media (review 208: 4 illustration pages around one ugoira animation). plan_review_media now takes work_id and drops refs whose pixiv asset id provably belongs to another work. Same-work refs (novel covers, illustrations), non-pixv refs (chat uploads) and empty work_id keep the legacy behavior, so ordinary submissions are unchanged.
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.
根因(review #208 事故第二层,业务根因)
#206(多页插画,4 个
kind:image资产)重抓替换为 #208(ugoira 动画)后,chain-206 的资产登记仍是旧作品的。发布链路出现两个确定性缺陷:plan_review_media的 assets 分支把所有非 document 媒体硬编码为MediaKind.PHOTO,无视已 staged 的type: animation→sendPhoto(animation_file_id)→ Telegram 确定性拒绝Can't use file of type animation as photo。2.84.2 曾把该 BadRequest 误分类为响应丢失(
BadRequest ⊂ NetworkError),触发无关转发反查与谎报回滚——#346(2.84.3)已修复该放大层;本 PR 修复业务根因层。2.84.3 部署后的恢复尝试已实际验证:同一拒绝被正确分类为确定失败,零重试零删除。修复
type/kind,来自 Telegram staging 事实)对 animation/video/audio 同样权威;asset 声明只补位,不覆盖。plan_review_media(..., work_id=):pixiv:<wid>:前缀资产若可证明属于其它作品则丢弃;同作品资产(novel cover/插图)、非 pixiv 资产(聊天上传)、空 work_id 保持旧行为。publish_from_file_ids传入work_id(pid)。边界
family_of(animation/audio 本就是 standalone singleton family,绝不进相册)。测试