Skip to content

Save As can capture a stale undo baseline for an edited background section #83

Description

@dustenhubbard

Problem

If a background section (b_section) is edited, then made the b_section via a save=False flicker (edits committed in memory but not written to disk), and the series is then Save-As'd, the undo baseline re-initialized for that section is taken from its stale on-disk file rather than its in-memory state.

Proposed

Flush the b_section (save it) before re-initializing undo state during Save As (main_window.py ~1549-1550), or assert its file is current. Also add a comment noting SectionStates.initialize's copy path assumes section.filepath is current.

Notes

Surfaced by the adversarial review of the undo-init change in PR #82 (which Closes #73). Pre-existing, not introduced by that change: in this state the section's committed edits are already lost to the saved .jser regardless (save reconstructs from the section files, not in-memory objects), and the undo history is cleared on Save As anyway. Tracking it as a latent save-flush gap.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions