Skip to content

[bugfix] storage: preserve saved canvas fingerprints - #601

Open
wangtiance wants to merge 1 commit into
ThinkFlowLab:mainfrom
wangtiance:codex/fix-legacy-canvas-fingerprints
Open

wangtiance wants to merge 1 commit into
ThinkFlowLab:mainfrom
wangtiance:codex/fix-legacy-canvas-fingerprints

Conversation

@wangtiance

Copy link
Copy Markdown
Collaborator

Summary

Restore access to projects saved before codec metadata was added. Preserve whether videoCodec and audioCodecs were absent, explicitly null, or populated when serializing stored metadata. This keeps the original job and command fingerprints valid without rewriting project files or weakening integrity checks.

Background

PR #563, merged as b36a4eb9, added codec metadata for MKV compatibility. Older generation records did not contain those keys. Loading an old record and serializing its frozen reference metadata inserted nulls, so the recomputed job fingerprint differed from the saved fingerprint. Storage then reported the project as requiring recovery and rejected the canvas open. Existing records and media remained on disk.

The PR’s Release checks passed. The MKV coverage created projects with the new schema, and the shared fixture was updated to contain the new null fields. Neither exercised an old job and checkpoint receipt with the original fingerprint. The regression cases in this PR run in the existing Python gate.

Linked issue

Labels

  • type:bug, area:assets, area:canvas.

Test plan

  • At 4b518031, 111 Python tests passed across creation contracts, video compatibility, and generation service. Eight frontend contract and playback tests, TypeScript checking, and generated contract verification also passed.
  • At the rebased tip be0b14d0, all three fingerprint regression cases passed under the PR’s cpu selector. Generated contract verification and git diff --check passed. The six touched files match the tested pre-rebase commit.
  • Full Release checks remain with CI.

Evidence that it works

  • At the pre-rebase revision identified above, the storage validator read all 1,146 commit records from five local projects without writing to those projects.
  • Before the fix, the normal project listing reported three projects as requiring recovery. With the patch, the same listing on isolated project copies returned all three as readable. Their POST /api/creation/projects/{id}/open-canvas requests each returned HTTP 200, with 29, 46, and 29 nodes respectively. No screenshot is attached. The evidence records the API outcome that controls whether the canvas can open.

Provider verification

  • No real provider was called. The isolated open tests used saved records and did not start job recovery.

Bilingual UI

  • No user-facing copy changed.

中文摘要

  • PR [feat] canvas: add MKV compatibility tip and one-click MP4 conversion #563 新增视频和音频编码字段后,旧记录中缺失的字段被自动补成 null,导致历史任务指纹校验失败,画布无法打开。
  • 当时的 CI 检查了新版工程的导入和转换,但没有用升级前的任务快照验证读取。这次在现有 Python 门禁补了字段缺失、显式空值和已知编码三种回归用例,并验证篡改仍会被拒绝。
  • 修复保留原始字段状态和指纹,无需迁移或改写工程文件。已只读校验 1,146 条提交记录,三个受影响工程的副本均可通过打开画布接口返回 HTTP 200。

## summary

- Preserve missing codec fields when serializing historical metadata.
- Keep explicit nulls and verified codec values in saved fingerprints.
- Regress old job inputs and checkpoint receipts without rewriting
  existing projects.

## validation

- Passed 111 Python tests, eight frontend tests, TypeScript checking,
  and generated contract verification.
- Validated 1,146 local commit records and opened three affected
  project copies through the canvas API.

Refs: ThinkFlowLab#563
@wangtiance wangtiance added type:bug Something is broken area:canvas Canvas, nodes and direct manipulation area:assets Assets, library and reference inputs labels Nov 30, 2026

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST CHANGES be0b14d No linked issue (related #563)

Dot,代表 @david6666666。

当前证据 60/100。 范围 3/3,正确性 3/3,验证 3/3,主张证据 0/3,简洁性 0/3。

保留「字段缺失、显式 null、有实际值」三种状态,比重写旧工程稳妥。当前提交的 Release checks 已过;回归覆盖旧快照、checkpoint 回执和篡改仍被拒绝。现在差的是用户侧证据:API 的 HTTP 200 说明后端接受了,但还没看到旧项目在画布中真正打开。能否用隔离旧项目补一张从恢复提示进入正常画布的截图,附上复现步骤?新增解释性代码注释按量表也记零。我没有自行打开那几个项目或重跑测试。

English summary: 60/100. The fingerprint compatibility tests and Release checks are green. Please attach a screenshot from the actual old-project canvas opening path.

@wangtiance

Copy link
Copy Markdown
Collaborator Author

@david6666666 已补上 Chrome 中实际打开旧画布的前后对照。两次使用同一份合成工程副本和同一份前端构建。工程由 #563 合并前的 b834c01d 生成,包含带引用的已完成任务,原始快照里没有两个 codec 字段。截图与样例均为合成数据。

复现步骤

  1. 将旧工程样例解压到空测试目录的 projects/ 下,保留 projects/Unified/project.json。两次验证分别使用该目录的独立副本,并用 OPENDIRECTOR_ROOT 指向各自的测试目录。
  2. 在修复前的后端 dbb36f0d 打开工程的画布链接。页面显示“工程提交记录缺失或损坏,已阻止自动覆盖”,open-canvas 返回 409。

修复前,旧工程在 Chrome 中显示恢复提示

  1. 在 PR 测试提交 be0b14d0 用 Chrome 打开同一个工程 ID。open-canvas 返回 200,画布显示两个节点、引用连线和已保存的生成结果 Actual generated text,页面显示「已保存到本机」。

修复后,Chrome 显示旧工程节点及已生成文本

注释里记录的约束是,显式 null 也已经参与部分已保存记录的指纹,所以读取旧记录时需要保留字段原有的存在状态。

English summary: The same synthetic pre-#563 project showed the recovery error on dbb36f0d and opened normally on be0b14d0, with both nodes and the previously generated text visible.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS be0b14d No linked issue (related #563)

Dot,代表 @david6666666。

复审 90/100(非批准)。 范围、正确性、验证、证据、简洁性依次为 3/3、3/3、3/3、3/3、0/3。

补图看过了:同一个合成旧工程,修复前落到恢复提示,修复后能看到两节点、引用连线和已保存生成文本。这次画布路径的证据齐了,现有回归和 Release checks 也都过了。我核对了截图,没有重跑 Chrome。解释性注释还在,简洁性按量表记零。这里是非表决复审,没有提交 Approve。

English summary: 90/100. The before/after screenshots close the canvas-evidence gap; exact-tip Release checks are green. Non-voting review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:assets Assets, library and reference inputs area:canvas Canvas, nodes and direct manipulation type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants