From dc32f27975ed01409712ffcbe6cb3843eb1886d0 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 29 Aug 2026 15:37:25 -0400 Subject: [PATCH] chore(sidebar): remove unused imports and dead vars from consolidated test wrappers Remove unused isSubsumedBy/idsFromStore imports from stars/mutes storage wrappers (not consumed by runMergeLaneStorageSuite), drop RELAY_KEY from sections/sort sync wrappers (not consumed by the suite), remove unused makeStore function from sections sync wrapper (superseded by makeSectionsStore), and remove the makeStore parameter from runWholeBlobSyncSuite (declared but never accessed in the body). Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- .../features/sidebar/lib/channelMutesStorage.test.mjs | 2 -- .../features/sidebar/lib/channelSectionsSync.test.mjs | 11 ----------- .../src/features/sidebar/lib/channelSortSync.test.mjs | 2 -- .../features/sidebar/lib/channelStarsStorage.test.mjs | 2 -- .../sidebar/lib/wholeBlobSync.shared.test.mjs | 2 -- 5 files changed, 19 deletions(-) diff --git a/desktop/src/features/sidebar/lib/channelMutesStorage.test.mjs b/desktop/src/features/sidebar/lib/channelMutesStorage.test.mjs index 166270a80b..a9734cb33e 100644 --- a/desktop/src/features/sidebar/lib/channelMutesStorage.test.mjs +++ b/desktop/src/features/sidebar/lib/channelMutesStorage.test.mjs @@ -1,11 +1,9 @@ import { boundMuteStore, DEFAULT_STORE, - isMutesStoreSubsumedBy, MAX_CHANNEL_MUTE_ENTRIES, mergeStores, parseMutePayload, - mutedChannelIdsFromStore, readChannelMutesStore, storageKey, writeChannelMutesStore, diff --git a/desktop/src/features/sidebar/lib/channelSectionsSync.test.mjs b/desktop/src/features/sidebar/lib/channelSectionsSync.test.mjs index 16a1694f66..0d7439c708 100644 --- a/desktop/src/features/sidebar/lib/channelSectionsSync.test.mjs +++ b/desktop/src/features/sidebar/lib/channelSectionsSync.test.mjs @@ -12,21 +12,11 @@ import { } from "./sidebarSyncTestHelpers.mjs"; import { runWholeBlobSyncSuite } from "./wholeBlobSync.shared.test.mjs"; -function makeStore(overrides = {}) { - return { - version: 1, - sections: overrides.sections ?? [], - assignments: overrides.assignments ?? {}, - ...overrides, - }; -} - function makeSectionsStore(sections = []) { return { version: 1, sections, assignments: {} }; } const RELAY = "wss://r.test"; -const RELAY_KEY = encodeURIComponent(RELAY); // ─── 17 shared whole-blob sync invariants ───────────────────────────────────── @@ -38,7 +28,6 @@ runWholeBlobSyncSuite({ subscribeMethod: "subscribeToSections", watermarkLane: "channel-sections", readOutbox: readChannelSectionsOutbox, - makeStore, makeNonEmptyStore: () => makeSectionsStore([{ id: "s1", name: "Work", order: 0 }]), decryptPayload: JSON.stringify({ diff --git a/desktop/src/features/sidebar/lib/channelSortSync.test.mjs b/desktop/src/features/sidebar/lib/channelSortSync.test.mjs index 288f24d7aa..874e3baf0e 100644 --- a/desktop/src/features/sidebar/lib/channelSortSync.test.mjs +++ b/desktop/src/features/sidebar/lib/channelSortSync.test.mjs @@ -17,7 +17,6 @@ function makeStore(groups = {}) { } const RELAY = "wss://r.test"; -const RELAY_KEY = encodeURIComponent(RELAY); // ─── 17 shared whole-blob sync invariants ───────────────────────────────────── @@ -29,7 +28,6 @@ runWholeBlobSyncSuite({ subscribeMethod: "subscribeToSortPrefs", watermarkLane: "channel-sort", readOutbox: readChannelSortOutbox, - makeStore, makeNonEmptyStore: () => makeStore({ channels: "recent" }), decryptPayload: JSON.stringify({ version: 1, diff --git a/desktop/src/features/sidebar/lib/channelStarsStorage.test.mjs b/desktop/src/features/sidebar/lib/channelStarsStorage.test.mjs index 35870aee96..c86668807e 100644 --- a/desktop/src/features/sidebar/lib/channelStarsStorage.test.mjs +++ b/desktop/src/features/sidebar/lib/channelStarsStorage.test.mjs @@ -1,12 +1,10 @@ import { boundStarStore, DEFAULT_STORE, - isStarsStoreSubsumedBy, MAX_CHANNEL_STAR_ENTRIES, mergeStores, parseStarPayload, readChannelStarsStore, - starredChannelIdsFromStore, storageKey, writeChannelStarsStore, } from "./channelStarsStorage.ts"; diff --git a/desktop/src/features/sidebar/lib/wholeBlobSync.shared.test.mjs b/desktop/src/features/sidebar/lib/wholeBlobSync.shared.test.mjs index 6cba809560..cf0eef010e 100644 --- a/desktop/src/features/sidebar/lib/wholeBlobSync.shared.test.mjs +++ b/desktop/src/features/sidebar/lib/wholeBlobSync.shared.test.mjs @@ -35,7 +35,6 @@ const RELAY_KEY = encodeURIComponent(RELAY); * @param {string} cfg.subscribeMethod - e.g. "subscribeToSections" or "subscribeToSortPrefs". * @param {string} cfg.watermarkLane - e.g. "channel-sections" or "channel-sort". * @param {Function} cfg.readOutbox - readChannelSectionsOutbox | readChannelSortOutbox - * @param {Function} cfg.makeStore - (overrides?) => store — lane-shaped store for basic ops * @param {Function} cfg.makeNonEmptyStore - () => non-empty store for bootstrap seed test * @param {string} cfg.decryptPayload - JSON.stringify of a valid remote store for adopt tests * @param {string} cfg.emptyDecryptPayload - JSON.stringify of valid but empty/cleared store @@ -59,7 +58,6 @@ export function runWholeBlobSyncSuite({ subscribeMethod, watermarkLane, readOutbox, - makeStore, makeNonEmptyStore, decryptPayload, emptyDecryptPayload,