commit 7ae37867a19834c79055cd8c6c6dac8e6885673c
parent f42f4a64fe84b584655c1bdad78818b14219a31a
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 30 Sep 2026 09:24:12 -0400
editor: review L2 — a storage patch of the locations keeps storage.health (and savedVideosLocationId): one saveSettings merge case
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/editor/app/settings/saveSettings.test.ts b/editor/app/settings/saveSettings.test.ts
@@ -62,6 +62,28 @@ test("an object nested inside a block replaces, it is not merged", () => {
assert.deepEqual(out.channelPriority.channels, { other: { tier: "paused" } });
});
+// A LOCATION WRITE KEEPS THE DRIVE-HEALTH TIMINGS. The /storage location
+// actions patch `storage` with `{ locations, defaultLocationId }` only; the
+// one-level merge is what keeps `storage.health` (and `savedVideosLocationId`,
+// which an add once erased before slice 4a).
+test("a storage patch of the locations keeps storage.health", () => {
+ const base = defaultSiteSettings();
+ base.storage = {
+ ...base.storage,
+ savedVideosLocationId: "cold",
+ health: { budgetMs: 4_000, inFlightPerLocation: 2 },
+ };
+ const out = mergeSettingsPatch(base, {
+ storage: {
+ locations: [{ id: "cold", label: "Cold", root: "/mnt/cold", autoRepoint: false }],
+ defaultLocationId: "cold",
+ },
+ });
+ assert.deepEqual(out.storage.health, { budgetMs: 4_000, inFlightPerLocation: 2 });
+ assert.equal(out.storage.savedVideosLocationId, "cold");
+ assert.equal(out.storage.locations.length, 1);
+});
+
test("saveSettings writes the merged result and touches nothing else", async () => {
writeFileSync(
process.env.SETTINGS_FILE!,