#1983 Guard Library mirrors against post-Save aliasing in version handlers - #1988
Closed
LarryThiessen wants to merge 1 commit into
Closed
#1983 Guard Library mirrors against post-Save aliasing in version handlers#1988LarryThiessen wants to merge 1 commit into
LarryThiessen wants to merge 1 commit into
Conversation
…version handlers After a Save, GSE.ReplaceSequence stores the editor's own sequence object into GSE.Library, so editframe.Sequence and the Library entry are the same table. The editor's per-version handlers each also "mirror" their change into the Library display cache, which then ran twice on one Versions array: - Delete Version removed two versions per click (2 versions -> 0; the tree showed no version rows at all). - New Version inserted two copies and crashed with a nil index in GUIDrawMacroEditor (Editor.lua:5889) when selecting the new node. - Drag-reorder applied the move twice, scrambling the order. Guard all three mirror sites with `libSeq ~= sequence` so the mirror only runs when the Library holds a distinct copy (i.e. before the first Save of the session). Also: Delete Version decremented MetaData.Default unconditionally; it now only shifts when the deleted index is at or before the Default, matching the rule the content-type keys already use. Fixes TimothyLuke#1983 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit 37f7917)
Owner
|
This fixes some of the bugs and introduces other. After applying this I can’t create a new version from the right hand menu. That’s why I am working on the whole of the problem not just this part. |
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.
Fixes #1983
Standalone resubmit of the second commit from closed PR #1982 — this part is independent of the content-version storage discussion there and addresses the still-open crash family in #1983.
Problem
After a Save,
GSE.ReplaceSequencestores the editor's own sequence object intoGSE.Library, soeditframe.Sequenceand the Library entry are the same table. The editor's per-version handlers also "mirror" their change into the Library display cache, which post-Save runs twice on oneVersionsarray:Editor.lua:5889: attempt to index field '?' (a nil value)inGUIDrawMacroEditor.All three work before the first Save of the session (separate copies) — that's the tell.
Fix
Guard the three mirror sites with
libSeq ~= sequenceso the mirror only runs when the Library holds a distinct copy. Also: Delete Version decrementedMetaData.Defaultunconditionally; it now only shifts when the deleted index is at/before the Default (same rule the content-type keys already use).Verified
In-game: delete keeps the remaining versions; New Version creates exactly one with no error.
luac -pclean. 2 files, +22/−5, cherry-picked onto current master (34b29a5).🤖 Generated with Claude Code