Fix Wave-2 review findings: FX union on re-park, per-project reconcile memo, shared undo mask, decayed test oracle

This commit is contained in:
2026-08-06 17:50:49 -04:00
parent c4038a9e9c
commit 024c619884
9 changed files with 244 additions and 105 deletions
+18 -3
View File
@@ -75,6 +75,8 @@ bool applyFlags(MediaTrack* tr, const std::vector<TrackFlagOp>& flags) {
} // namespace
const int kViewUndoMask = UNDO_STATE_TRACKCFG | UNDO_STATE_ITEMS | UNDO_STATE_MISCCFG;
bool writeIfChanged(MediaTrack* tr, const char* parm, double value) {
if (GetMediaTrackInfo_Value(tr, parm) == value) return false;
SetMediaTrackInfo_Value(tr, parm, value);
@@ -87,12 +89,25 @@ bool parkTrack(ViewModeModel& model, const std::string& guid, MediaTrack* tr,
if (!model.holdsSnapshotFlags(guid)) {
TrackSnapshot snap = snapshotTrack(tr);
// A restore hands the flags back immediately but leaves the chain offline
// until the reclaimer gets to it, so a re-park lands here with the FX half
// still held over a still-parked chain. Keep it: the live read above would
// record the park's own offline state as the user's, permanently.
// still held over a still-parked chain. Union the live read against the
// record rather than overwriting either way — see unionFxOfflineOnRepark.
//
// `prior->fxHeld` is provably redundant here today — eraseIfSpent
// (view_mode_model.cpp) guarantees a surviving record has fxHeld == true
// — so the false arm is unreached. Kept anyway: it is the direct
// statement of what this branch actually needs, and cheaper to keep true
// than to re-derive if that guarantee ever loosens.
const TrackSnapshot* prior = model.snapshot(guid);
if (prior && prior->fxHeld) {
if (prior && prior->fxHeld && prior->fxKeying == FxKeying::Identity) {
snap.fxOffline = unionFxOfflineOnRepark(prior->fxOffline, snap.fxOffline);
snap.fxKeying = FxKeying::Identity;
} else if (prior && prior->fxHeld) {
// Slot-keyed legacy record (lifted from a pre-identity view_state): no
// identities to union against, so fall back to the old behavior and
// trust the record verbatim over live slots that may have moved since.
snap.fxOffline = prior->fxOffline;
snap.fxKeying = prior->fxKeying;
}