Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: clear song-specific reactive gains on audio replacement

Adam Eivyf4c269bda187
diff --git a/server/services/musicVideo/composition.js b/server/services/musicVideo/composition.js
index c77357eada..49dab4987b 100644
--- a/server/services/musicVideo/composition.js
+++ b/server/services/musicVideo/composition.js
@@ -208,6 +208,7 @@ export function invalidateCompositionTiming(composition) {
...composition,
textCues: (composition.textCues || []).map((cue) => ({ ...cue, startSec: null, endSec: null })),
posterSec: null,
+ ...(composition.reactiveSections ? { reactiveSections: [] } : {}),
...(composition.narrativeEvents ? { narrativeEvents: composition.narrativeEvents.map((event) => ({ ...event, anchor: null })) } : {}),
};
}
diff --git a/server/services/musicVideo/projectsFile.test.js b/server/services/musicVideo/projectsFile.test.js
index 388f1c8722..43dfde9a6a 100644
--- a/server/services/musicVideo/projectsFile.test.js
+++ b/server/services/musicVideo/projectsFile.test.js
@@ -221,6 +221,7 @@ describe('projectsFile federation (#1770)', () => {
],
style: { color: '#FFCC00' },
posterSec: 2,
+ reactiveSections: [{ sectionId: 'intro', gain: 0.5, maxGain: 0.2 }],
} });
const saved = await file.getProject(p.id);
expect(saved.composition).toEqual({
@@ -233,6 +234,7 @@ describe('projectsFile federation (#1770)', () => {
],
style: { color: '#ffcc00', font: 'sans' },
posterSec: 2,
+ reactiveSections: [{ sectionId: 'intro', gain: 0.5, maxGain: 0.2 }],
});
expect((await file.cloneProject(p.id)).composition).toEqual(saved.composition);
@@ -241,6 +243,10 @@ describe('projectsFile federation (#1770)', () => {
const swapped = await file.updateProject(p.id, { uploadedAudioFilename: 'other.wav' });
expect(swapped.composition.posterSec).toBeNull();
+ // Section IDs belong to the previous song: stale gain entries cannot be
+ // rebound in the editor and would block future document authoring.
+ expect(swapped.composition.reactiveSections).toEqual([]);
+ expect((await file.getProject(p.id)).composition.reactiveSections).toEqual([]);
expect(swapped.composition.textCues.map((c) => [c.id, c.text, c.startSec, c.endSec]))
.toEqual(saved.composition.textCues.map((c) => [c.id, c.text, null, null]));