fix(snapping): avoid mutating the previous snap log when tagging from scope - #10527
fix(snapping): avoid mutating the previous snap log when tagging from scope#10527davidfirst wants to merge 4 commits into
Conversation
PR Summary by QodoFix tagging flow to avoid mutating previous snap log when copying
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewPrevious review resultsReview updated until commit 59ad8c4 Results up to commit 9fc4bae
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewResults up to commit c285bd2
Great, no issues found!Qodo reviewed your code and found no material issues that require review |
|
Code review by qodo was updated up to the latest commit 9fc4bae |
|
Code review by qodo was updated up to the latest commit 59ad8c4 |
When tagging from scope with
copyLogFromPreviousSnap(the_tagflow),getLogmutated the previous snap's log object in place with the new tag's message and date. Since the consumer component'slogis a reference to the cached Version object's log, and that same cached Version is later persisted when marked as hidden (and exported viaincludeParents), the previous snap ended up stored with the tag's message and timestamp — losing its original ones. Visible inbit log --show-hidden: the hidden merged snap and the tag share the exact same timestamp and message, which also breaks the log ordering between them.The fix returns a new log object instead of mutating, keeping the intended behavior for the new tag (author attribution from the previous snap, new date) while leaving the previous snap's log intact.