Repository navigation
Fix CapCut 7.x active timeline writes - #51
jaecho1001 wants to merge 1 commit into
Conversation
renezander030
left a comment
There was a problem hiding this comment.
Hi @jaecho1001, thanks for this. The implementation is careful in the places that matter: containment on the main_timeline_id value before it is joined, realpathSync checks so a symlinked timeline cannot escape Timelines/, the 8.7+ template-2.tmp priority left intact, explicit non-active paths kept isolated, and docs, help, changelog and the generated command reference all updated in the same pass. That is more diligence than most first PRs to this repo bring.
Two things before I can merge.
1. Evidence for the premise. I have asked in #50 for the artifacts that separate an active timeline from an archived one. Everything below assumes the pointer turns out to be authoritative.
2. The canonical flip is too broad. In discoverDraftStore, canonical ??= activeTimeline fires for any project below 8.7 where Timelines/project.json resolves to a directory holding draft_info.json or draft_content.json. Pre-8.7 is the bulk of the existing user base, and those projects are served correctly today from the root file. If a given project keeps Timelines/ as an archive rather than as the live document, this makes the nested snapshot canonical, reads come from stale data, and the sync path then pushes that stale timeline out to the root mirrors. That converts a silent no-op into overwritten work, which is the worse failure.
What I would like instead:
- Add the nested active file as a write target unconditionally. That part is safe and captures most of the value.
- Promote it to canonical only under a narrower condition: the root mirror is missing or unparseable, or the nested timeline hash differs from the root's and the nested file's mtime is newer. Otherwise keep the root file canonical.
- Surface the decision.
doctorandinfoshould name which file was selected and why, so a user seeing an unexpected edit can diagnose it without reading source. The existinglayoutfield is the right place to hang it.
Also worth adding to test/timelines-directory.test.mjs: a pre-8.7 project with a Timelines/ directory whose nested draft is older than the root, asserting the root stays canonical and nothing gets rolled back.
I am approving the workflow run so CI executes on Node 18, 20 and 22. Once that is green and the tests above are in, this is close.
Rene
|
Hi @jaecho1001, closing this for now to keep the queue moving, since the repro artifact requested in #50 (the nested draft_info.json still holding the old text right after a set-text that reported success) has not come through. Code quality was never the concern. If the artifact lands and confirms the nested file is the live document on a real pre-8.7 project, happy to reopen and take this with the narrowed canonical gate discussed in the review. |
Summary
Timelines/project.jsonto the active nested draft for verified CapCut 7.x projectssync-timelinesrepair in the structurally safe active-timeline → root-mirror directiontemplate-2.tmppriority and treat legacy nested files as diagnostic-only thereRoot cause
CapCut 7.7 can store the document it actually opens at
Timelines/<main_timeline_id>/draft_info.json. The project-rootdraft_info.jsonis a derived mirror. Root-only discovery therefore let commands return success while editing a file that CapCut replaced from the untouched nested timeline on reopen.Compatibility and safety
The nested pointer is authoritative only for pre-8.7 CapCut storage. Modern projects retain their existing canonical selection and never write discovered legacy nested files. Explicit non-active file paths remain isolated, unreadable explicit mirrors fall back without dropping the canonical write target, and the active path must remain within the real
Timelinesdirectory.Validation
npm run buildnpm run lintnpm run docs:commandsgit diff --checkCloses #50