From df4a70bfa623fcb8fb7fe8fb13ed1fd1db6809cf Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:29:23 -0500 Subject: [PATCH] Scope user block cache by profile --- js/userBlocks.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/js/userBlocks.js b/js/userBlocks.js index c8aae597..25e05274 100644 --- a/js/userBlocks.js +++ b/js/userBlocks.js @@ -1124,7 +1124,11 @@ class UserBlockListManager { } _loadLocal(actorHex) { - const cached = profileCache.get("blocks"); + const normalizedActorHex = normalizeHex(actorHex); + if (!normalizedActorHex) { + return null; + } + const cached = profileCache.getProfileData(normalizedActorHex, "blocks"); if (Array.isArray(cached)) { return new Set(cached); } @@ -1132,7 +1136,15 @@ class UserBlockListManager { } _saveLocal(actorHex) { - profileCache.set("blocks", Array.from(this.blockedPubkeys)); + const normalizedActorHex = normalizeHex(actorHex); + if (!normalizedActorHex) { + return; + } + profileCache.setProfileData( + normalizedActorHex, + "blocks", + Array.from(this.blockedPubkeys), + ); } _getSeedState(actorHex) { @@ -1145,7 +1157,8 @@ class UserBlockListManager { return this.seedStateCache.get(normalized); } - const stored = profileCache.get("blocks_meta") || {}; + const stored = + profileCache.getProfileData(normalized, "blocks_meta") || {}; const seeded = !!stored.seeded; const removals = new Set(Array.isArray(stored.removals) ? stored.removals : []); @@ -1160,7 +1173,7 @@ class UserBlockListManager { const state = this.seedStateCache.get(normalized); if (!state) return; - profileCache.set("blocks_meta", { + profileCache.setProfileData(normalized, "blocks_meta", { seeded: state.seeded, removals: Array.from(state.removals), });