Skip to content

fix: SG-43710: saveSession(asACopy=true) overwrites the working session filename#1303

Open
markreidvfx wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
markreidvfx:nas_contrib_save_as_copy_fix_v1
Open

fix: SG-43710: saveSession(asACopy=true) overwrites the working session filename#1303
markreidvfx wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
markreidvfx:nas_contrib_save_as_copy_fix_v1

Conversation

@markreidvfx

Copy link
Copy Markdown
Contributor

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 forward writeAsCopy as the saveAs option, so Session::write() defaulted to calling setFileName(). Second, RvSession::write() unconditionally called setFileName() after the write, so even with the correct option the rename would still happen. The fix passes saveAs=writeAsCopy in the WriteRequest and removes the unconditional setFileName().

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: Pass saveAs=writeAsCopy in the write request; remove unconditional setFileName() after write.

If possible, provide screenshots.

N/A

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>
@bernie-laberge bernie-laberge changed the title fix: saveSession(asACopy=true) overwrites the working session filename fix: SG-43710: saveSession(asACopy=true) overwrites the working session filename Jun 15, 2026
@bernie-laberge bernie-laberge added PR: Acknowledged New PR has been acknowledge by the TSC community Contribution from the Open RV Community labels Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Contribution from the Open RV Community PR: Acknowledged New PR has been acknowledge by the TSC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants