Repository navigation
4.6.6 - #662
4.6.6#662
Conversation
fix: guard scene loading and autosave state
Animation v2
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ac474647e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /** 上次保存(或打开时)的内容,内容没变就不保存,例如只是添加了一条空轨道 */ | ||
| const lastTextRef = useRef(serializeAnimation(doc)); | ||
|
|
||
| const debouncedSave = useMemo(() => debounce((next: IAnimationDocument) => saveRef.current(next), SAVE_DELAY), []); |
There was a problem hiding this comment.
Serialize animation saves to preserve edit order
When a user pauses for more than 300 ms between edits, the debounce can start another asynchronous file save while the previous saveRef.current promise is still pending. Since these requests are not queued, a slower earlier write can finish after a newer write and overwrite the latest animation on disk; the later cache mutation can also leave the editor displaying content that no longer matches the file. Chain or otherwise serialize these saves so completion order always follows edit order.
Useful? React with 👍 / 👎.
No description provided.