scenario load: preserve control values across a port-set change#2111
Open
bltzr wants to merge 1 commit into
Open
scenario load: preserve control values across a port-set change#2111bltzr wants to merge 1 commit into
bltzr wants to merge 1 commit into
Conversation
When an avnd process's port count changes (e.g. an updated add-on that gained a port), opening an existing scenario runs ProcessModel::check_all_ports(), which recreates the ports with default values and migrates the saved data via the 3-arg reloadPortsInNewProcess(). That path called loadData() without DontReloadValue, so ControlInlet::loadData dropped every value and the process reloaded with all defaults (soundfile path blank, every control reset to its init value). Pass DontReloadValue there, exactly as LoadPresetCommand already does, so a matched port (guarded by type()==type() && name()==name()) keeps its value. This is the same fix as 6fed47b ("presets: fix that values sometimes did not reload"), applied to the scenario-load migration path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AvD2PFHZtW6pfsh3gGhayg
jcelerier
reviewed
Jul 13, 2026
jcelerier
left a comment
Member
There was a problem hiding this comment.
need to test this as there's various cases in which this could break
| { | ||
| new_p->loadData(old_p.data); | ||
| // Preserve values across a port-set change (e.g. an updated add-on that | ||
| // gained a port): without DontReloadValue, loadData drops the value and |
Member
There was a problem hiding this comment.
Can you ask Claude to not put this kind of slop comments ? 😁
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.
Problem
When an avnd process's port count changes — e.g. an add-on gains a new port in an update — opening a scenario saved with the older version reloads that process with every value reset to default (soundfile path blank, all controls back to their init values). This breaks backward-compat for any existing document once an object grows a port.
Cause
The count mismatch makes
ProcessModel::check_all_ports()recreate the ports (with default values) and migrate the saved data through the 3-argDataflow::reloadPortsInNewProcess(). That path calledloadData(old_p.data)withoutDontReloadValue, andControlInlet::loadDatadrops the value unless that flag is set — so the recreated ports keep their defaults.Fix
Pass
Process::PortLoadDataFlags::DontReloadValuein that migration, exactly asLoadPresetCommandalready does. It's guarded by the existingtype()==type() && name()==name()match, so a value is only ever restored into an identical port.This is the same fix as 6fed47b ("presets: fix that values sometimes did not reload"), applied to the scenario-load migration path rather than the preset path.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AvD2PFHZtW6pfsh3gGhayg