fix: SG-43710: saveSession(asACopy=true) overwrites the working session filename#1303
Open
markreidvfx wants to merge 1 commit into
Open
Conversation
When the Mu saveSession command is called with asACopy=true, the intent is to write a copy without changing the current session. Two bugs prevented this: 1. RvSession::write() did not forward writeAsCopy as the "saveAs" option to Session::write(). Without it, Session::write() defaults saveAs to false and calls setFileName(), updating the session to point at the copy. 2. RvSession::write() unconditionally called setFileName() after Session::write() returned, so even if saveAs were set correctly the rename would still happen. Fix: pass saveAs=writeAsCopy in the WriteRequest and remove the unconditional setFileName() from RvSession::write(). Signed-off-by: Mark Reid <markreid@netflixanimation.com>
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.
Linked issues
N/A
Summarize your change.
Fix
saveSession(asACopy=true)so it writes a copy of the session without changing the current session's filename.Describe the reason for the change.
Two bugs caused
saveSession(asACopy=true)to rename the working session to the copy path. First,RvSession::write()did not forwardwriteAsCopyas thesaveAsoption, soSession::write()defaulted to callingsetFileName(). Second,RvSession::write()unconditionally calledsetFileName()after the write, so even with the correct option the rename would still happen. The fix passessaveAs=writeAsCopyin theWriteRequestand removes the unconditionalsetFileName().Describe what you have tested and on which operating system.
Tested on Rocky Linux 9.
Add a list of changes, and note any that might need special attention during the review.
RvSession.cpp: PasssaveAs=writeAsCopyin the write request; remove unconditionalsetFileName()after write.If possible, provide screenshots.
N/A