fix: skip undefined tune data when a tune is in its default state - #3020
Open
Hyhyhyyy wants to merge 1 commit into
Open
fix: skip undefined tune data when a tune is in its default state#3020Hyhyhyyy wants to merge 1 commit into
Hyhyhyyy wants to merge 1 commit into
Conversation
Hyhyhyyy
requested review from
TatianaFomina,
gohabereg,
ilyamore88 and
neSpecc
as code owners
August 15, 2026 07:18
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.
Summary
Closes #1683.
When a Block Tune's
save()returnsundefined(i.e. the tune is in its default state and has nothing to persist), the value was still written totunesData[name]. This leaves an explicitundefinedentry in the saved tunes object, which then gets carried through load/save cycles.This guards the assignment so that only defined tune data is stored:
Changes
src/components/block/index.ts: skip storing a tune's data whensave()returnsundefined.Notes
The
BlockTune.save()type isBlockTuneData, but in practice a tune may intentionally returnundefinedto signal "no data / default state" (as described in the issue). The localas BlockTuneData | undefinedcast keeps the type checker happy while allowing the runtime guard.How to test
save()returnsundefinedin its default state.undefinedvalue.