Implement profile-scoped caching and signer invalidation logic

- Updated `profileCache.js` to support clearing runtime memory on signer change.
- Updated `NostrClient` to trigger `clearSignerRuntime` on `setActiveSigner`.
- Updated list services (`subscriptions`, `userBlocks`, `hashtagPreferences`, `watchHistory`) to listen for `runtimeCleared` and reload data.
- Updated `NostrClient` sync metadata methods to default to the active profile pubkey.
- Added `partition-updated` event emission to `profileCache`.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-17 21:43:35 +00:00
1 parent 1f8dfab811
commit 3deb8d08f0
6 files changed
+50 -3

No files matched your search

+7
View File
@@ -633,6 +633,11 @@ class UserBlockListManager {
profileCache.subscribe((event, detail) => {
if (event === "profileChanged") {
this.reset();
} else if (event === "runtimeCleared" && detail.pubkey === this.activePubkey) {
this.reset();
if (this.activePubkey) {
this.loadBlocks(this.activePubkey);
}
}
});
}
@@ -678,6 +683,8 @@ class UserBlockListManager {
async loadBlocks(userPubkey, options = {}) {
const normalized = normalizeHex(userPubkey);
this.activePubkey = normalized;
if (!normalized) {
this.reset();
this.loaded = true;